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.
Set the bits so they store −82 in 8-bit two's complement. Read as an unsigned number, what is the pattern's value U?
Set the bits to the 8-bit result of 0011 1100 >> 1. What is the result's value R in decimal?
Use the Karnaugh map to find the minimal sum-of-products (SOP) form of F(A, B, C, D) = Σm(0, 1, 2, 5, 6, 9, 10, 12, 13, 14). How many product terms N does it have?
For F(A, B, C, D) = Σm(4, 7, 10, 11, 12, 13, 14) + d(6, 8, 15), where d marks the don't-care conditions, find the number N of essential prime implicants.
A 135 kHz sine wave is sampled at 100 kHz without an anti-aliasing filter. At which frequency fa does it appear in the samples? Give it in kHz.
A microcontroller with a 4 MHz clock sets its UART baud rate as fclk/(16·D), with D a whole number rounded to the nearest value. The target is 9600 baud. Find the percentage error of the real baud rate (positive when it is too fast).
Answer: U = 174
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.
Answer: R = 30
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 right by 1 moves every bit 1 places to the right; bits that fall off the right end are lost and zeros come in on the left.
Answer: N = 4
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.
Every group is a rectangle of 2ᵏ cells; edge cells are neighbours of the cells on the opposite edge.
Another grouping of the same size exists; it has the same number of terms and literals.
Answer: N = 4
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.
The largest groups that can be formed from 1s and Xs.
Answer: fa = 35 kHz
Sampling: an ADC measures the signal fs times per second. By the Nyquist–Shannon theorem a frequency f is captured correctly only while f < fs/2, the Nyquist (folding) frequency, so the sampling rate must exceed twice the highest signal frequency. A higher frequency is not lost: it shows up as an alias at fa = |f − k·fs|, with the whole number k that brings the result between 0 and fs/2. The samples cannot tell the two apart, so an analogue anti-aliasing filter must remove everything above fs/2 before the ADC.
The dashed curve in the figure is the alias: it passes through exactly the same samples.
Answer: e = 0.1603 %
UART: an asynchronous serial link sends each byte as a frame: one start bit (low), the data bits, an optional parity bit and one or two stop bits (high). The baud rate is the number of bits per second, so one bit lasts Tb = 1/baud and a frame of n bits lasts n/baud. The common 8N1 format has 10 bits per byte. The baud generator divides the clock: baud = fclk/(16·D) with a whole number D, so the real baud rate differs slightly from the target; an error below about 2 % is usually acceptable.
An error below about 2 % is usually acceptable.
ExamProblems · examproblems.com/courses/digital-electronics