Digital Electronics, Data Converters and Microprocessors — ESE E&T
Weightage: Digital electronics and microprocessors are a dependable, mostly numerical block in the E&T papers. The topics are rule-based, so success comes from a few fast habits: simplify with a K-map, count flip-flops from the modulus, and compute memory size from address lines.
1. Number systems
For bits in two's complement the range is to . A negative number is formed by inverting the bits and adding 1. Sign-magnitude and one's complement have two representations of zero, while two's complement has one.
Worked example. In 8 bits, is : invert to and add 1. The range is to .
Gray code changes only one bit between adjacent values, which avoids glitches in position encoders. BCD stores each decimal digit in 4 bits.
2. Boolean algebra and K-maps
The key laws are De Morgan's: and . Others are absorption () and consensus ().
NAND and NOR are universal gates: any function can be built from either alone.
A Karnaugh map groups adjacent 1s in powers of two (1, 2, 4, 8) to find a minimal sum of products. Groups wrap around the edges, and don't care cells may be used to enlarge a group.
Worked example. has 1s wherever , so the single group of four gives .
3. Combinational circuits
- Half adder: sum and carry . Full adder: sum and carry .
- A ripple-carry adder is slow since the carry passes through every stage. A carry-lookahead adder computes carries in parallel.
- A multiplexer selects one of inputs, and it can implement any function of variables by using one variable as data input. A 4:1 mux therefore implements any three-variable function.
- A decoder activates one of outputs from inputs, and with an OR gate it implements functions. An encoder does the reverse. A comparator gives greater than, equal and less than.
- A hazard is a momentary glitch from unequal delays. A static hazard is removed by adding the consensus term.
4. Sequential circuits
Latches are level-sensitive and flip-flops are edge-triggered. Characteristic equations:
| Flip-flop | Next state |
|---|---|
| SR | (with ) |
| JK | |
| D | |
| T |
A JK flip-flop with toggles. If it is level-triggered and the pulse is long, it toggles repeatedly: the race-around condition, which edge triggering or a master-slave design cures.
Counters. An -flip-flop binary counter has modulus (60 states need 6 flip-flops). An asynchronous (ripple) counter is simple but slower, since delays accumulate, while a synchronous counter clocks all stages together. A ring counter of flip-flops has modulus and a Johnson (twisted-ring) counter has modulus . A shift register moves data one place per clock and multiplies or divides by two.
Finite state machines. A Moore machine's output depends only on the state, and a Mealy machine's output depends on the state and input. Mealy usually needs fewer states.
Timing. The minimum clock period is , so with a propagation delay of 10 ns and set-up of 2 ns the maximum frequency is MHz. Set-up and hold times are windows around the clock edge in which the data must be stable.
5. Logic families
| Family | Notes |
|---|---|
| TTL | Bipolar, fast, moderate power; unused inputs float high |
| CMOS | Very low static power, wide noise margin, high fan-out |
| ECL | Fastest, because transistors never saturate, but power-hungry |
Noise margin is the tolerance of a gate to input noise. Fan-out is the number of gate inputs a gate can drive. CMOS power is mainly dynamic, . Open-collector (open-drain) outputs allow a wired-AND and bus sharing, and tri-state outputs allow several drivers on one bus.
6. Data converters
A DAC with bits and reference has a step of . A 4-bit DAC with 5 V reference has a step of V. The R-2R ladder needs only two resistor values and so matches better than a binary-weighted network.
An ADC has quantisation error up to half a step. Types:
- Flash: one comparator per level (), the fastest and the most hardware.
- Successive approximation: clock cycles for bits, a good balance.
- Dual-slope: slow but accurate and noise-rejecting, used in digital multimeters.
The sampling theorem needs a sampling rate of at least twice the highest signal frequency, and an anti-aliasing filter before the converter.
7. Memory
A memory with address lines has locations. A 1K 8 memory has locations of 8 bits, so it needs 10 address lines and 8 data lines.
| Type | Property |
|---|---|
| ROM, PROM | Non-volatile; programmed once |
| EPROM, EEPROM, Flash | Non-volatile; erasable |
| SRAM | Volatile, fast, flip-flop cell, no refresh |
| DRAM | Volatile, dense, capacitor cell, needs refresh |
Address decoding uses the upper address lines to generate chip selects. Programmable logic (PLA, PAL, CPLD, FPGA) lets a designer configure logic in the field.
8. The 8085 microprocessor
The 8085 is an 8-bit processor with a 16-bit address bus, so it addresses 64 KB. Address lines to are multiplexed with the data lines to and are separated by ALE and an external latch. Its internal clock is half the crystal frequency.
- Registers: the accumulator, flag register, B, C, D, E, H and L, with the pairs BC, DE and HL, plus the program counter and stack pointer.
- Flags: Sign, Zero, Auxiliary carry, Parity and Carry.
- Addressing modes: immediate, register, direct, register indirect and implied.
- Interrupts: TRAP (non-maskable, highest priority, edge and level), then RST 7.5, RST 6.5, RST 5.5 and INTR. TRAP and the three RST interrupts jump to fixed addresses (vectored), while INTR must supply an instruction such as RST or CALL from outside.
- Stack: it grows downward, and the instruction CALL pushes the return address.
Instruction timing counts T-states. A machine cycle (opcode fetch, memory read or write, I/O) has several T-states, and the opcode fetch normally has four. For the 8051 microcontroller, remember the 8-bit architecture, four I/O ports, two timers and on-chip memory.
Common traps
- Forgetting that two's complement is asymmetric. One more negative value than positive.
- Counting Johnson modulus as . It is .
- Using comparators for a flash ADC. It is .
- Mixing which 8085 interrupt is non-maskable. Only TRAP.
- Ignoring don't cares in the K-map.
Memory aids
- "Ring n, Johnson 2n": counter moduli.
- "Flash fastest, dual-slope accurate": ADC types.
- "2 to the n": memory locations from address lines.
Summary
Digital design starts with number representation and Boolean simplification by K-map. Combinational blocks such as adders, multiplexers and decoders are built from gates, and sequential designs from flip-flops with counters and finite state machines under set-up and hold constraints.
Converters trade speed and accuracy, memories are sized by address lines, and the 8085 is described by its registers, flags, interrupts and 64 KB address space.
Exam protocol
- Derive the modulus before counting flip-flops.
- Use a K-map for any function of four variables or fewer.
- Compute memory size from address and data lines.
- Check the clock period against propagation delay and set-up time.