⚑ ELT 102 · Digital Logic & Solid State Devices Hands-On Tinkercad Lab
Unit 1 Β· Digital Interface Β· Lab

Codes, Routes & Conversions: Where Digital Meets the World

Six circuits that move information between forms: decoders that turn binary codes into actions, encoders that turn events into codes, multiplexers and demultiplexers that route many signals down one wire β€” and the two great translators at the analog border, the R-2R DAC and the flash ADC. You'll build every one from chips you already own, ending with a staircase waveform you generated and an analog-to-digital converter you constructed from op-amps.

⏱ 3 Γ— 75-Minute Sessions πŸ–₯ Tinkercad Circuits (Free) πŸ”§ 6 Circuits Β· Gates + 4511 + '193 + 741s πŸ“Š Signal-Path & Staircase Playground βœ… 6-Question Knowledge Check

Learning Objectives

By the end of this lab, you will be able to:

  • Construct a 2-to-4 line decoder from 74HC04/08 gates, verify its one-hot behavior (exactly one output active for each binary input code), and relate it to the commercial 74HC138/139 decoders.
  • Operate a BCD-to-7-segment decoder/driver (CD4511, the 74HC4511's twin) driving a real 7-segment display, and trace how a 4-bit code becomes a human-readable digit.
  • Construct a 4-to-2 encoder from 74HC32 OR gates, demonstrate the inverse relationship between encoding and decoding, and explain why commercial encoders (74HC147/148) add priority logic.
  • Build a 2-to-1 multiplexer implementing Y = SΜ„Β·A + SΒ·B, and demonstrate that a demultiplexer is simply a decoder whose enable input carries the data β€” converting your Part 1 circuit into a 1-to-4 demux with one wire.
  • Construct a 4-bit R-2R ladder DAC, measure its 16 output levels, calculate its resolution (1 LSB = Vref/16 β‰ˆ 0.3125 V), and generate a staircase waveform by driving it from a 74HC193 binary counter.
  • Construct a 2-bit flash ADC from a resistor reference ladder and three LM741 comparators, map its quantization thresholds with a potentiometer sweep, and encode its thermometer-code output to binary with your Part 3 encoder.
  • Evaluate the resolution/speed/complexity trade-offs of flash conversion (2βΏβˆ’1 comparators) and quantization error (Β±Β½ LSB), and identify the analog-digital boundary as a critical point in real systems β€” including their security.

Key Terms & Concepts

Click any card to reveal its definition. Review these before you build.

Coding Circuits
Decoder
Coding Circuits
πŸ”„ Click to reveal definition
Definition
Takes an n-bit binary code and activates exactly ONE of its 2ⁿ outputs β€” one-hot output. A 2-to-4 decoder turns "10" into "output #2 only." Address decoders in memory chips are this circuit scaled up: your 16 GB of RAM finds every byte with decoders. Commercial parts: 74HC139 (dual 2-to-4), 74HC138 (3-to-8).
Encoder
Coding Circuits
πŸ”„ Click to reveal definition
Definition
The decoder's inverse: 2ⁿ input lines in, an n-bit binary code out β€” "input #2 is active" becomes "10." Every key you press reaches your computer through an encoder. Commercial parts (74HC147/148) add priority: if two inputs fire at once, the highest-numbered wins, resolving the ambiguity our simple gate version ignores.
BCD & 7-Segment
Coding Circuits
πŸ”„ Click to reveal definition
Definition
Binary-Coded Decimal: each decimal digit 0–9 stored as its own 4-bit code. A BCD-to-7-segment decoder (CD4511 / 74HC4511 / classic 7447) translates that code into the seven segment-drive signals that paint the digit on a display β€” a decoder with 7 simultaneously-active outputs instead of one-hot.
One-Hot Output
Coding Circuits
πŸ”„ Click to reveal definition
Definition
An output pattern where exactly one line is active at a time. It's the decoder's signature and your Part 1 acceptance test: for every input code, count the lit LEDs β€” the answer must always be one. Two lit LEDs = a wiring error, guaranteed.
Routing Circuits
Multiplexer (MUX)
Routing Circuits
πŸ”„ Click to reveal definition
Definition
A digitally-controlled selector switch: n select bits choose which of 2ⁿ data inputs reaches the single output. Y = SΜ„Β·A + SΒ·B is the 2-to-1 version you'll wire. MUXes let one wire, one ADC, or one bus serve many sources by taking turns β€” the foundation of all shared-media communication. Commercial: 74HC157 (quad 2-to-1), 74HC151 (8-to-1).
Demultiplexer (DEMUX)
Routing Circuits
πŸ”„ Click to reveal definition
Definition
The MUX's mirror: one data input, routed to the ONE of 2ⁿ outputs the select code names. The elegant secret you'll prove in Part 4: a demux IS a decoder β€” feed data into the decoder's enable pin and the selected output copies the data while all others stay quiet. Same silicon, two job titles (74HC138 datasheets say "decoder/demultiplexer" for exactly this reason).
Select Lines
Routing Circuits
πŸ”„ Click to reveal definition
Definition
The address inputs of a MUX/DEMUX. The count rule is pure binary: n select lines command 2ⁿ channels β€” 1 line for 2 channels, 3 lines for 8. Going the other way: routing 16 channels? You need ⌈logβ‚‚16βŒ‰ = 4 select bits. This arithmetic sizes every bus and every memory address in computing.
Time-Division Sharing
Routing Circuits
πŸ”„ Click to reveal definition
Definition
The MUX's payoff: rapidly cycling the select lines lets many slow signals share one fast channel, each getting time slices. Your phone call, multiplexed with thousands of others onto one fiber, is this lab's Part 4 running at gigahertz. The receiving end demultiplexes β€” decoder with your time slot's address.
The Analog Border
DAC & the R-2R Ladder
The Analog Border
πŸ”„ Click to reveal definition
Definition
A Digital-to-Analog Converter turns a binary code into a proportional voltage. The R-2R ladder does it with just two resistor values: each bit's switch contributes a binary-weighted share, so Vout = Vref Γ— (code/2ⁿ). Your headphones are hearing a many-bit descendant of the 4-bit ladder you'll build.
Resolution & the LSB
The Analog Border
πŸ”„ Click to reveal definition
Definition
The smallest voltage step a converter can express: 1 LSB = Vref / 2ⁿ. Your 4-bit DAC on 5 V: 5/16 β‰ˆ 0.3125 V per step β€” chunky. A 16-bit audio DAC: 5/65536 β‰ˆ 76 Β΅V β€” smooth. Bits buy fineness, exponentially.
Flash ADC
The Analog Border
πŸ”„ Click to reveal definition
Definition
The fastest Analog-to-Digital architecture: a resistor ladder creates every threshold at once, a bank of 2βΏβˆ’1 comparators tests the input against all of them simultaneously (producing thermometer code β€” comparators light up from the bottom like a thermometer), and an encoder converts to binary. Speed paid for in hardware: 8 bits costs 255 comparators.
Quantization Error
The Analog Border
πŸ”„ Click to reveal definition
Definition
The rounding built into every ADC: all input voltages within one step map to the same code, so the digital value can be off by up to Β±Β½ LSB. It isn't a defect to eliminate β€” it's the price of admission to digital, reduced (never removed) by adding bits. You'll watch it directly as your pot sweeps between thresholds and the code refuses to budge.

πŸ–₯ Tinkercad Setup Notes: Building What the Library Doesn't Stock

Seventh lab, and by now the pattern is the point: Tinkercad's library carries some of these functions as chips and omits others β€” and the omissions become the best builds. Here's the inventory honestly mapped:

Three Sessions, One Idea
This lab is long because it closes a loop: codes (Parts 1–3) β†’ routes (Part 4) β†’ conversions (Parts 5–6), and the final circuit β€” the flash ADC β€” contains an encoder, comparators from the op-amp lab, and a resistor ladder cousin of the DAC. Budget Session 1 for Parts 1–2, Session 2 for Parts 3–4, Session 3 for Parts 5–6. Don't rush Part 5's measurement table; the DAC data feeds two analysis questions.

πŸ”§ Virtual Parts List

QtyComponent (Tinkercad name)Setting / PartUsed In
1Breadboard (small)β€”All parts
1Power Supply5.00 VAll parts
4SlideswitchSPDT harnessCode inputs A/B Β· data Β· DAC bits
1 ea74HC04 Β· 74HC08 Β· 74HC32NOT Β· AND Β· ORDecoder Β· encoder Β· MUX (Parts 1, 3, 4)
1CD4511BCD β†’ 7-segment (β‰ˆ74HC4511)Part 2
17-Segment Display + 7 Γ— 220 Ξ©common cathodePart 2
174HC1934-bit up/down counterPart 5 staircase drive
8Resistor4 Γ— 1 kΞ© Β· 4 Γ— 2 kΞ©R-2R ladder (Part 5) β€” plus 1 spare 2 kΞ© for the terminator
4Resistor 1 kΞ©reference ladderFlash ADC thresholds (Part 6)
3Op Amp LM741single 5 V supplyFlash ADC comparators (Part 6)
1Potentiometer 10 kΞ©wiper = V_inPart 6 analog input
1Function Generatorsquare Β· 1 Hz Β· 0–5 VPart 5 counter clock
4–6LED + 220 Ξ©assorted colorsDecoder/encoder/MUX/ADC indicators
1 eaMultimeter Β· OscilloscopeV mode Β· 500 ms/divDAC levels Β· staircase waveform
~24Wiresred / black / greenAll parts

πŸ“ The Circuits You Will Build

Five figures for six builds β€” the demux shares Figure 1's circuit, because that identity is the lesson. Commercial 74xx equivalents are noted on every figure for translation to real hardware.

A1 A0 '04 AΜ…1 AΜ…0 AND AND AND AND AΜ…1 Β· AΜ…0 AΜ…1 Β· A0 A1 Β· AΜ…0 A1 Β· A0 Y0 β†’ LED (code 00) Y1 β†’ LED (code 01) Y2 β†’ LED (code 10) Y3 β†’ LED (code 11) Each AND recognizes one code. Commercial: 74HC139 (dual 2-to-4) Β· 74HC138 (3-to-8). DEMUX conversion: gate each AND with a DATA line (Part 4).
Figure 1 β€” 2-to-4 decoder from one '04 and one '08. Two inverters make AΜ…1 and AΜ…0; four AND gates each recognize exactly one of the four codes, so exactly one LED lights per input β€” one-hot. Only three of these AND gates fit on one 74HC08 (it holds four 2-input gates, and Y3 needs A1Β·A0 β€” all four fit exactly). In Part 4, feeding a DATA signal into each AND (making them 3-input via a second gate layer, or gating the inverter supply of the enable) turns this same circuit into a 1-to-4 demultiplexer β€” the procedure shows the one-chip trick.
CD4511 β‰ˆ 74HC4511 1 Β· B (bit 1) 2 Β· C (bit 2) 3 Β· LTΜ„ (tie HIGH) 4 Β· BLΜ„ (tie HIGH) 5 Β· LE (tie LOW) 6 Β· D (bit 3, MSB) 7 Β· A (bit 0, LSB) 8 Β· GND 16 Β· V_DD (+5 V) 15 Β· f β†’ 220 Ξ© β†’ seg f 14 Β· g β†’ 220 Ξ© β†’ seg g 13 Β· a β†’ 220 Ξ© β†’ seg a 12 Β· b β†’ 220 Ξ© β†’ seg b 11 Β· c β†’ 220 Ξ© β†’ seg c 10 Β· d β†’ 220 Ξ© β†’ seg d 9 Β· e β†’ 220 Ξ© β†’ seg e BCD switches β†’ A B C D (note scattered pins: 7, 1, 2, 6!). Display common cathode β†’ GND. Classic TTL twin: 7447 (active-LOW outputs, common-ANODE display).
Figure 2 β€” The applied decoder: CD4511 + 7-segment display. Four switches enter a BCD code; seven outputs paint the digit. Mind two traps: the BCD input pins are scattered (A=7, B=1, C=2, D=6 β€” not in order), and the three control pins must be tied (LTΜ„ and BLΜ„ HIGH, LE LOW) or the display will blank, lamp-test, or freeze. One 220 Ξ© per segment.
4-to-2 Encoder ('32) D0 (btn) β€” no gate needed D1 D2 D3 OR A0 = D1+D3 OR A1 = D2+D3 Press D2 β†’ code 10. Press D3 β†’ code 11. Commercial: 74HC148 adds priority + valid flag. 2-to-1 MUX ('04+'08+'32) A SΜ„ AND B S AND OR Y Y = SΜ„Β·A + SΒ·B β€” the select line opens exactly one AND "door." Commercial: 74HC157.
Figure 3 β€” Encoder (left) and MUX (right). The encoder is two OR gates reading off which input fired β€” note D0 needs no gate at all (code 00 means "nothing else pressed"). The MUX is the inverting amplifier's digital cousin: SΜ„ opens the A door, S opens the B door, the OR merges. One inverter, two ANDs, one OR β€” spare gates on chips you've already placed.
1 kΞ© 1 kΞ© 1 kΞ© b0 (LSB) 2 kΞ© b1 2 kΞ© b2 2 kΞ© b3 (MSB) 2 kΞ© 2 kΞ© terminator V_out β†’ multimeter / scope V_out = 5 V Γ— (8Β·b3 + 4Β·b2 + 2Β·b1 + b0) / 16 Β· 1 LSB = 0.3125 V Step 2 upgrade: replace the four switches with 74HC193 outputs QAβ†’b0 … QDβ†’b3, clock at 1 Hz β†’ live staircase on the scope.
Figure 4 β€” 4-bit R-2R ladder DAC. Each switch drives its 2 kΞ© leg with 5 V (bit=1) or GND (bit=0); the 1 kΞ© backbone halves each bit's influence as it travels toward the output, producing perfect binary weighting from only two resistor values. Don't omit the 2 kΞ© terminator at the LSB end β€” it completes the ladder's math. Commercial reference: DAC0808 (8-bit).
+5 V 1 kΞ© 1 kΞ© 1 kΞ© 1 kΞ© 3.75 V 2.50 V 1.25 V βˆ’+ C3 Β· 741 βˆ’+ C2 Β· 741 βˆ’+ C1 Β· 741 V_in (pot wiper) L3 β†’ LED (V_in > 3.75) L2 β†’ LED (V_in > 2.50) L1 β†’ LED (V_in > 1.25) Thermometer code: LEDs light bottom-up. Optional: L-outputs β†’ Part 3 encoder β†’ binary b1 b0. Commercial one-chip ADC: ADC0804 (8-bit SAR).
Figure 5 β€” 2-bit flash ADC from three comparators. The equal-resistor ladder slices 5 V into thresholds at 1.25, 2.50, and 3.75 V; each 741 (single 5 V supply: pin 7 β†’ +5 V, pin 4 β†’ GND) compares Vin against one threshold. Sweep the pot and the LEDs fill like a thermometer β€” 2βΏβˆ’1 = 3 comparators for 2 bits, which is why 8-bit flash costs 255 of them.

Commercial 74xx / Converter Reference

FunctionThis lab's buildCommercial partKey pins (commercial)
2-to-4 / 3-to-8 decoder (+demux)'04 + '08 gates74HC139 / 74HC138'138: A,B,C in 1-3 Β· Y0-Y7 out 15-7 Β· enables 4,5,6 Β· pwr 8/16
BCD β†’ 7-segmentCD4511 (in Tinkercad)74HC4511 / 74474511: A=7 B=1 C=2 D=6 Β· a-g=13,12,11,10,9,15,14 Β· pwr 8/16
Encoder (priority)'32 gates74HC147 / 74HC148'148: in 0-7 Β· A0-A2 out 9,7,6 Β· EI 5 Β· pwr 8/16
2-to-1 / 8-to-1 MUX'04+'08+'32 gates74HC157 / 74HC151'151: D0-D7 Β· select 11,10,9 Β· Y 5 Β· pwr 8/16
DACR-2R ladder + '193 driveDAC0808 (8-bit)'193: clk-up 5 Β· QA-QD 3,2,6,7 Β· clear 14 Β· pwr 8/16
ADC3 Γ— LM741 flashADC0804 (8-bit SAR)741 (each): +in 3 Β· βˆ’in 2 Β· out 6 Β· V+ 7 Β· Vβˆ’ 4
Decoder: 1-of-2ⁿ one-hot MUX: n selects β†’ 2ⁿ channels DAC: V_out = V_ref Β· code/2ⁿ 1 LSB = V_ref/2ⁿ Flash ADC: 2βΏβˆ’1 comparators Q-error ≀ Β±Β½ LSB

πŸ›  Step-by-Step Procedure

Session 1 = Parts 1–2 (decoders) Β· Session 2 = Parts 3–4 (encoder, MUX/DEMUX) Β· Session 3 = Parts 5–6 (DAC/ADC).

Part 1 β€” 2-to-4 Decoder from Gates (β‰ˆ25 min)

  1. Workspace. New circuit "LastName – Interface Lab." Breadboard, 5.00 V supply to rails. Two slide switches (SPDT harness) as inputs A1 and A0; four LED + 220 Ξ© indicators as Y0–Y3.
  2. Seat the '04 and '08. Power ritual on both (14 β†’ +5 V, 7 β†’ GND). Wire A1 β†’ 04 pin 1 and A0 β†’ 04 pin 3; their outputs (pins 2, 4) are AΜ…1 and AΜ…0. Run A1, AΜ…1, A0, AΜ…0 to four labeled distribution columns.
  3. Wire the four recognizers per Figure 1 on the '08: gate 1 (pins 1,2β†’3) gets AΜ…1, AΜ…0 β†’ Y0; gate 2 (4,5β†’6) gets AΜ…1, A0 β†’ Y1; gate 3 (9,10β†’8) gets A1, AΜ…0 β†’ Y2; gate 4 (12,13β†’11) gets A1, A0 β†’ Y3.
  4. One-hot verification. Simulate. Step the switches through 00, 01, 10, 11 and record which LED lights in Data Table 1. Acceptance test: exactly one LED per code, every code. Two LEDs ever lit at once means a distribution wire is crossed.
  5. Think ahead. One sentence in the report: your computer's RAM has ~34 address bits. How many outputs would a full 34-to-2³⁴ decoder have? (This is why memory decoders are built in trees.)

Part 2 β€” The Applied Decoder: BCD β†’ 7-Segment (β‰ˆ25 min)

  1. Seat the CD4511 (16-pin: VDD = 16 β†’ +5 V, GND = 8). Immediately tie the control pins: LTΜ„ (3) β†’ +5 V, BLΜ„ (4) β†’ +5 V, LE (5) β†’ GND. Skipping these is the #1 failure in this part.
  2. Inputs. Four slide switches β†’ the BCD pins in their scattered order: bit 0 β†’ pin 7 (A), bit 1 β†’ pin 1 (B), bit 2 β†’ pin 2 (C), bit 3 β†’ pin 6 (D). Label the switches on the workspace.
  3. Display. Place the 7-segment (common cathode), its common pin β†’ GND. Wire segment outputs through seven individual 220 Ξ© resistors: pin 13β†’a, 12β†’b, 11β†’c, 10β†’d, 9β†’e, 15β†’f, 14β†’g (hover the display's pins to match a–g).
  4. Count 0 through 9. Enter each BCD code 0000–1001 and record the displayed digit in Data Table 2. Then try 1010–1111 (10–15): the 4511 blanks β€” note this, and contrast with what a hex-capable decoder would do.
  5. Control-pin experiments. Momentarily ground LTΜ„ (all segments light β€” lamp test), ground BLΜ„ (display blanks), and raise LE with a digit showing, then change the switches (display freezes β€” LE is a latch, last lab's lesson hiding inside this chip). Record all three.

Part 3 β€” 4-to-2 Encoder from OR Gates (β‰ˆ15 min)

  1. Inputs and outputs. Four pushbuttons D0–D3, each with a 10 kΞ© pull-down (button from +5 V to its column, resistor from column to GND). Two LEDs as the code output A1 (MSB), A0 (LSB).
  2. Wire the '32 per Figure 3: gate 1 (pins 1,2β†’3): D1, D3 β†’ A0. Gate 2 (4,5β†’6): D2, D3 β†’ A1. D0 connects to nothing β€” pressing it yields code 00 by silence.
  3. Verify. Press each button alone and record the 2-bit code in Data Table 3: D0β†’00, D1β†’01, D2β†’10, D3β†’11 β€” the exact inverse of Part 1.
  4. Find the flaw. Press D1 and D2 together: the output claims 11, i.e. "D3" β€” a lie. Record it, and explain in one sentence what the 74HC148's priority logic would have answered instead (highest input wins: 10).

Part 4 β€” MUX, then the DEMUX Revelation (β‰ˆ25 min)

  1. Build the 2-to-1 MUX per Figure 3 with spare gates: inputs A and B from two slide switches, select S from a third; S β†’ 04 spare inverter β†’ SΜ„; AND gate 1: SΜ„Β·A; AND gate 2: SΒ·B; OR them β†’ Y β†’ LED.
  2. Prove selection. Set A = 1, B = 0. S = 0 β†’ Y shows A (1). S = 1 β†’ Y shows B (0). Now wiggle the unselected input and watch Y ignore it completely. Fill Data Table 4.
  3. Route a live signal. Replace input B with the function generator (square, 1 Hz, 0–5 V). S = 1: the LED blinks (you routed the generator). S = 0: steady A. One wire = many sources, taking turns.
  4. The demux revelation. Return to your Part 1 decoder. Pick ONE change: replace the AΜ…1Β·AΜ…0-style two-input recognition with three-input recognition by routing a DATA switch through spare '08 gates β€” concretely: take each decoder output Yn into a fresh AND gate paired with DATA, and move the LEDs to those gate outputs. Now A1 A0 select a destination and DATA's value appears there: 1-line-to-4-line demultiplexer. Toggle DATA with the code at 10 β€” only LED 2 blinks. Record in Data Table 4.
  5. Say it in one sentence. For the report: why do 74HC138 datasheets title the chip "decoder/demultiplexer"?

Part 5 β€” R-2R DAC & the Staircase (β‰ˆ30 min)

  1. Build the ladder per Figure 4 on a clear breadboard area: backbone of three 1 kΞ© resistors between four node columns; a 2 kΞ© leg rising from each node to a slide switch (SPDT: GND / leg / +5 V); the 2 kΞ© terminator from the LSB-end node to GND. Multimeter (V) from the MSB-end node (Vout) to GND.
  2. Predict, then measure the corners. Predict with Vout = 5 Γ— code/16, then measure codes 0000, 0001 (1 LSB!), 1000 (MSB alone = 2.5 V), 1111. Record predicted vs measured in Data Table 5.
  3. Fill the table. Measure the remaining codes (order suggested in the table). The steps should march up by β‰ˆ0.3125 V each time. Any code that breaks the pattern β†’ check that bit's 2 kΞ© leg and switch.
  4. Binary weight check. From your data: does code 1000 alone equal the sum of 0111 + 1 LSB? Show the arithmetic in the report β€” that identity is binary weighting, measured.
  5. Automate: the staircase. Seat the 74HC193 (16-pin: VCC 16, GND 8; tie CLR pin 14 β†’ GND, LOAD pin 11 β†’ +5 V, DOWN-clock pin 4 β†’ +5 V). Function generator (square, 1 Hz, 0–5 V) β†’ UP-clock pin 5. Replace the four switches: QA (pin 3) β†’ b0 leg, QB (2) β†’ b1, QC (6) β†’ b2, QD (7) β†’ b3. Oscilloscope on Vout, 500 ms/div.
  6. Watch it climb. Run: Vout ascends 16 steps and wraps to zero β€” a staircase waveform, the counting of the '193 made visible as voltage. Sketch or screenshot it; record step height and period in Data Table 5. You have built a (slow) signal generator from a counter and eight resistors.

Part 6 β€” 2-Bit Flash ADC (β‰ˆ30 min)

  1. Reference ladder. Four 1 kΞ© resistors in series from +5 V to GND. Verify the taps with the multimeter: 3.75 V, 2.50 V, 1.25 V top to bottom.
  2. Comparator bank. Three LM741s, each powered single-supply: pin 7 β†’ +5 V, pin 4 β†’ GND. Wire each tap to one comparator's inverting input (pin 2): C1 gets 1.25 V, C2 gets 2.50 V, C3 gets 3.75 V.
  3. Analog input. 10 kΞ© pot across +5 V/GND; wiper β†’ all three non-inverting inputs (pin 3), and β†’ multimeter so you can read Vin precisely.
  4. Thermometer display. Each comparator output (pin 6) β†’ LED + 220 Ξ© β†’ GND, stacked vertically L1 (bottom) to L3 (top).
  5. Sweep and map. Turn the pot slowly from 0 to 5 V. The LEDs fill bottom-up β€” thermometer code. Record in Data Table 6 the Vin at which each LED turns on, versus the ladder's theoretical thresholds. Then park the pot at 1.8 V and nudge it Β±0.2 V: the code doesn't move. You are standing inside one quantization step β€” that immobility is quantization error, experienced.
  6. Optional: close the loop to binary. Route L1, L2, L3 into encoder logic (b1 = L2; b0 = L3 + (L1Β·LΜ„2) β€” one OR, one AND, one inverter from your spares) and two LEDs show the count 00–11 in binary. Note: the 741's HIGH (~3.5 V) is marginal for 74HC inputs; in Tinkercad it works β€” on real hardware you'd use an LM339 comparator with a pull-up. Record the binary column in Data Table 6.
  7. Wrap up. Complete the Analysis Questions and Knowledge Check, then Print/Save your report with all six data tables.
Troubleshooting
Decoder lights two LEDs? A distribution wire (A vs AΜ…) is swapped β€” check the inverter outputs first. 7-segment shows garbage or nothing? Control pins: LTΜ„/BLΜ„ HIGH, LE LOW; then check the scattered BCD pin order (A=7!). DAC steps uneven? One leg's resistor is 1 k where it should be 2 k (or vice versa), or the terminator is missing β€” the ladder is unforgiving about its ratio. Staircase stuck at zero? The '193's CLR (14) must be LOW and LOAD (11) HIGH; also confirm the clock swings 0–5 V. ADC LEDs all on or all off? Comparator inputs swapped β€” thresholds go to pin 2 (βˆ’), the pot to pin 3 (+). ADC LED half-bright? Normal near a threshold: the comparator is mid-transition; nudge the pot.

πŸ“‹ Data Tables

Tables persist when you print this page.

Data Table 1 β€” 2-to-4 Decoder (Part 1)

A1A0Y0Y1Y2Y3# of LEDs lit
00
01
10
11

Data Table 2 β€” BCD β†’ 7-Segment (Part 2)

D C B A00000001001000110100010101100111100010011010–1111
Digit shown
Control experimentObserved display behavior
LTΜ„ grounded
BLΜ„ grounded
LE raised, then inputs changed

Data Table 3 β€” 4-to-2 Encoder (Part 3)

Button pressedA1A0Code correct?
D0
D1
D2
D3
D1 + D2 together

Data Table 4 β€” MUX & DEMUX (Part 4)

TestS / codeY / destinationObservation
MUX: A=1 B=0S=0
MUX: A=1 B=0S=1
MUX: wiggle unselected inputβ€”
MUX: B = 1 Hz generatorS=1
DEMUX: DATA toggledcode 10
DEMUX: DATA toggledcode 01

Data Table 5 β€” R-2R DAC (Part 5)

Code b3b2b1b0DecimalPredicted V = 5Β·n/16Measured V_out
00000
00011
00102
01004
01117
10008
110012
111115
Staircase: step height Β· period per full ramp

Data Table 6 β€” Flash ADC (Part 6)

V_in rangeTheoretical thresholdMeasured turn-on V_inL3 L2 L1Binary b1 b0 (opt.)
0 – 1.25 Vβ€”β€”
1.25 – 2.50 V1.25 V
2.50 – 3.75 V2.50 V
3.75 – 5.00 V3.75 V
Quantization test: code change while nudging pot Β±0.2 V inside a step?

πŸ“ˆ Interactive Signal-Path & Conversion Playground

All six circuits, live. The digital modes draw the signal path with active routes in green; the converter modes plot the transfer function β€” the staircase that defines digital-analog conversion β€” with your operating point riding on it. Rehearse each part here before wiring it.

What To Notice
In DAC mode, press Auto-Count and watch the dot climb the staircase exactly as your scope will show in Part 5 β€” then read the step height off the axis: 0.3125 V. In ADC mode, drag Vin slowly: the dot slides horizontally inside a tread with the code frozen, then jumps a riser β€” the geometry of quantization error. And compare the MUX and DEMUX drawings: same trapezoid, arrows reversed. The routing family is one idea wearing two hats.

✍ Analysis Questions

Answer in complete sentences in your lab report.

  1. State the input/output relationship of a decoder and an encoder in one sentence each, and use your Data Tables 1 and 3 to show they are inverses.
  2. In Part 3 you caught the simple encoder lying when two buttons were pressed. Explain how the 74HC148's priority scheme resolves it, and give one real device where priority encoding is essential.
  3. Defend the sentence "a demultiplexer is a decoder with data on its enable" using your Part 4 step 4 observations. Why do manufacturers sell one chip for both jobs?
  4. From Data Table 5: compute the measured step size between consecutive codes and compare to the theoretical 1 LSB = 312.5 mV. Then compute what 1 LSB would be for an 8-bit and a 16-bit converter on the same 5 V reference β€” and explain what those numbers mean for audio quality.
  5. Your staircase generator (counter + DAC) is a primitive arbitrary-waveform generator. Describe what waveform you'd get if the '193 counted down instead, and what you'd get alternating up/down.
  6. Flash conversion needed 3 comparators for 2 bits. Derive the comparator count for n bits, evaluate it for 8 and 10 bits, and explain the engineering trade this architecture makes (and why oscilloscope front-ends pay it gladly).
  7. Security connection: sensor-spoofing attacks target exactly the boundary you built in Part 6 β€” if an attacker can nudge Vin across one comparator threshold, the digital system downstream sees a different "fact." Using your Data Table 6 thresholds, state the minimum voltage perturbation that changes your ADC's output code, and explain in two sentences why more bits of resolution can make such tampering both harder to hide and easier to detect.

Key Facts Reference Box

Decoder
n bits in β†’ one-hot of 2ⁿ out
Encoder
2ⁿ lines in β†’ n-bit code out
MUX / DEMUX
manyβ†’one / oneβ†’many Β· n selects = 2ⁿ ch.
Demux identity
= decoder with data on enable
CD4511 control pins
LTΜ„ HIGH Β· BLΜ„ HIGH Β· LE LOW
R-2R output
V_out = V_ref Γ— code / 2ⁿ
This lab's LSB (4-bit, 5 V)
5/16 = 0.3125 V
Flash ADC cost
2ⁿ βˆ’ 1 comparators
Thermometer code
Comparators fill bottom-up
Quantization error
≀ Β±Β½ LSB Β· shrinks with bits, never 0

Interactive Knowledge Check

Six questions drawn directly from the lab. Select an answer for each, then press Grade My Quiz.

← Lab: Latches & Flip-Flops 🏠 Course Home Back to Top ↑