Number systems
- Place values
- binary 2k, octal 8k, hex 16k
- To decimal
- Σ dk·bk
- From decimal
- divide by the base, read the remainders bottom-up
- Hex ↔ binary
- one hex digit = 4 bits
- Two’s complement
- invert the bits and add 1
Formula sheets, the key method steps for every topic and 6 practice problems, with full solutions at the back.
The 8-bit pattern 1010 0101 stores a signed integer in two's complement. What is its value N in decimal?
Set the bits to the 8-bit result of 0110 0101 << 1. What is the result's value R in decimal?
In this Karnaugh map exactly one 1 has no neighbouring 1, so it stays a group of one cell (a full minterm of four literals) in the minimal SOP form. Neighbours across the map edges count. Click that cell.
A synchronous mod-9 counter counts 0, 1, …, 8 and then returns to 0. It starts at 5. Which count Q (in decimal) does it show after 32 clock pulses?
A recorder samples 2 channels at 2 kHz each with a 16-bit ADC. Each sample is stored in whole bytes. Find the memory M needed for a 10 min recording, in MB (1 MB = 10⁶ bytes).
An 8-channel multiplexer feeds one ADC. Each conversion takes 20 µs, and after every channel switch the input needs 2 µs to settle. The channels are scanned in turn without pause. Find the sampling rate fs of each channel, in kHz.
Answer: N = −91
Positional number systems: each digit is worth its value times a power of the base. In binary the places are worth 1, 2, 4, 8, 16, …; in hexadecimal 1, 16, 256, …, with A–F standing for 10–15. In 8-bit two's complement the leftmost bit is worth −128 instead of +128, which is how negative numbers are stored.
The other bits keep their normal positive values.
Answer: R = 202
Setting bits: each bit is worth a power of two (128, 64, …, 1). One hex digit is exactly four bits, and in 8-bit two's complement the leftmost bit is worth −128. Bitwise operations work on each bit position separately.
Shifting left by 1 moves every bit 1 places to the left; bits that fall off the left end are lost and zeros come in on the right.
Answer: AB = 00, CD = 11
Karnaugh maps: the cells are ordered in Gray code (00, 01, 11, 10), so neighbouring cells, including the ones across the edges, differ in exactly one variable. Group the 1s in rectangles of 1, 2, 4, 8 or 16 cells, as large as possible and as few as possible, until every 1 is covered. Each group is one product term: the variables that stay constant inside it. A group of 2ᵏ cells loses k variables. Don't-cares (X) may be used to make groups bigger but never have to be covered. Grouping the 0s instead gives the minimal POS form.
A 1 with a neighbouring 1 can join a group of two or more.
Answer: Q = 1
Flip-flops and counters: a flip-flop changes only at the active clock edge. D copies its input (Q⁺ = D); T toggles when T = 1; JK holds for 00, resets for 01, sets for 10 and toggles for 11. An n-bit binary counter has 2ⁿ states and counts modulo 2ⁿ; a mod-N counter goes 0, 1, …, N − 1 and back to 0, and needs the smallest n with 2ⁿ ≥ N flip-flops. Each stage of a ripple counter halves the frequency, so the last output of a mod-N counter runs at fclk/N. A Johnson counter of n flip-flops has 2n states, a ring counter n.
Every 9 pulses bring the counter back to the same state.
Answer: M = 4.8 MB
Data rates: every channel delivers fs samples per second of N bits, so the raw rate is channels × fs × N bit/s. In memory a sample takes whole bytes (a 12-bit sample is stored in 2 bytes), so the memory for a recording is channels × fs × bytes per sample × time. A multiplexed ADC converts the channels one after another: each conversion (with settling) takes t, so one round of n channels takes n·t and each channel is sampled at 1/(n·t).
Answer: fs = 5.682 kHz
Data rates: every channel delivers fs samples per second of N bits, so the raw rate is channels × fs × N bit/s. In memory a sample takes whole bytes (a 12-bit sample is stored in 2 bytes), so the memory for a recording is channels × fs × bytes per sample × time. A multiplexed ADC converts the channels one after another: each conversion (with settling) takes t, so one round of n channels takes n·t and each channel is sampled at 1/(n·t).
ExamProblems · examproblems.com/courses/digital-electronics