Electrical Engineering › Section R · Digital concepts, number systems, and codes › Topic R.1
Digital and analog quantities, logic levels, and waveforms
Part 3 of the course moves from circuits that handle smoothly varying voltages to circuits that handle only two values. This topic sets up the language of digital electronics: what makes a quantity digital, how a voltage stands for a 1 or a 0, and how to read the pulse waveforms that carry bits.
Continuous and discrete quantities
An analogue (US: analog) quantity can take any value in a continuous range. A room's temperature does not jump from 20 °C to 21 °C; it passes through every value in between, as does a microphone's voltage. A digital quantity takes only values from a discrete set. Read the thermometer once a minute and round each reading to 0.1 °C, and the smooth curve becomes a list of numbers, each writable as a code of 1s and 0s. Sampling (picking instants) and quantising (picking levels) are the two steps, taught fully in "Analog-to-digital and digital-to-analog conversion".
Why so much electronics is digital
A digital circuit only has to tell two levels apart, so moderate noise does not change the information, and each gate restores clean levels. Digital data copies without loss, stores compactly, can be checked for errors and suits programmable hardware. The physical world stays analogue, so most systems are mixed. In a phone call, a microphone's voltage goes to an analogue-to-digital converter (ADC), a processor compresses and sends the numbers, and at the far end a digital-to-analogue converter (DAC) and amplifier drive the earpiece. Systems joining electronics to mechanisms, such as robots, are called mechatronic.
Bits, codes and positive logic
The binary system has two digits, 0 and 1, each called a bit (binary digit). A circuit represents them by two voltage levels, HIGH and LOW. In positive logic, HIGH means 1 and LOW means 0; this course uses positive logic throughout, though the reverse, negative logic, appears in some older material. A group of bits forms a code: \(n\) bits give \(2^n\) patterns, so 4 bits give 16 codes and 8 bits give 256. Codes stand for numbers, letters and instructions, as the later topics of this section show.
Logic levels and the forbidden region
Real circuits never give exactly 0 V or exactly the supply, so each logic family specifies ranges. An input reads LOW for any voltage up to \(V_{IL(\max)}\) and HIGH for any voltage from \(V_{IH(\min)}\) upward. For a typical 3.3 V CMOS input, LOW is 0 to 0.8 V and HIGH is 2.0 to 3.3 V. Between them lies the forbidden, or indeterminate, region: a voltage there may read either way, and it can make a CMOS input draw extra current. Output limits and noise margins come in "Programmable and fixed-function gates: logic levels and noise margins".
Worked example: reading input voltages
Signals of 0.3 V, 1.2 V, 2.6 V and 3.1 V drive (a) a 3.3 V CMOS input with limits 0.8 V and 2.0 V, and (b) a 5 V CMOS input with limits 1.5 V and 3.5 V, 30% and 70% of its supply. How does each read? 1. On (a), 0.3 V is at most 0.8 V: LOW. 2. 1.2 V lies between 0.8 V and 2.0 V: indeterminate. 3. 2.6 V and 3.1 V are at least 2.0 V: HIGH. 4. On (b), 0.3 V and 1.2 V are at most 1.5 V: LOW. 5. 2.6 V and 3.1 V are below 3.5 V: indeterminate. Check: a 3.3 V output cannot be trusted to give a valid HIGH at a 5 V CMOS input.
Pulses and digital waveforms
A digital waveform switches between LOW and HIGH. A positive-going pulse starts LOW, rises and returns; a negative-going pulse starts HIGH, drops and returns. The first edge in time is the leading edge and the second the trailing edge. An ideal pulse has vertical edges. Real edges take time: rise time \(t_r\) and fall time \(t_f\) run between 10% and 90% of the amplitude, and pulse width \(t_W\) is taken between the 50% points, as in "Pulse waveforms, repetition rate, duty cycle, and average value" (which writes \(t_p\)). Digital work treats edges as ideal unless timing is tight.
Period, frequency and duty cycle
A periodic waveform repeats every period \(T\), measured between matching points such as successive leading edges, and its frequency is \(f = 1/T\) in hertz. A nonperiodic waveform, such as a stream of data bits, has pulses of varying width and spacing. The duty cycle of a periodic pulse waveform is the share of each period the pulse fills:
A square wave, HIGH for half of each period, has a 50% duty cycle.
Worked example: a periodic pulse train
An oscilloscope shows leading edges 60 ns apart, and each pulse is HIGH for 15 ns at the 50% points. Find the period, frequency and duty cycle. 1. Period, the spacing of matching edges: \(T = 60\,\text{ns}\). 2. Frequency: \(f = \frac{1}{60\,\text{ns}} = 16.7\,\text{MHz}\) to three significant figures. 3. Duty cycle: \(\frac{15}{60} \times 100\% = 25\%\). 4. Check: the waveform is LOW for the other 45 ns, and \(15 + 45 = 60\,\text{ns}\).
The clock and timing diagrams
Digital systems are paced by a clock, a periodic waveform whose period is one bit time, the interval each bit occupies on a data line. Data lines change on a chosen clock edge and hold steady in between; the clock itself carries no information. A timing diagram draws several waveforms on one time axis so their relationships can be read directly. If over eight bit times line A carries 1, 1, 0, 1, 0, 0, 1, 1 and line B carries 0, 1, 1, 1, 0, 1, 1, 0, reading the columns shows both HIGH together only in bit times 2, 4 and 7.
Worked example: serial or parallel transfer
Serial transfer sends bits one after another on one line; parallel transfer sends them all at once on separate lines. Compare sending a 16-bit word with a 50 MHz clock. 1. Bit time: \(\frac{1}{50\,\text{MHz}} = 20\,\text{ns}\). 2. Serial: \(16 \times 20\,\text{ns} = 320\,\text{ns}\) on one data line. 3. Parallel: one bit time, 20 ns, on 16 data lines. 4. Check: the time ratio, 16, equals the line ratio. Long links such as USB are still serial, at much higher bit rates, because many parallel wires are bulky and hard to keep in step.
Common mistakes to avoid
First, quoting a threshold without its family: 2.6 V is HIGH for a 3.3 V CMOS input but indeterminate for a 5 V CMOS one. Second, treating the forbidden region as a third logic value; it is only a band where correct reading is not guaranteed. Third, calling the rising edge of a negative-going pulse its leading edge; that pulse falls first. Fourth, measuring pulse width at the base or top instead of the 50% points. Fifth, taking the period from the start to the end of one pulse, which is the pulse width.
Key takeaways
Analogue quantities vary continuously; digital ones take discrete values, and sampling plus quantising links them. Digital signals resist noise and copy without loss, and real systems join the two worlds with ADCs and DACs. A bit is 0 or 1; positive logic makes HIGH = 1, and n bits give 2ⁿ codes. Each family sets input ranges, with a forbidden region between V_IL(max) and V_IH(min). Pulses have leading and trailing edges; f = 1/T and duty cycle = t_W/T × 100%. A clock period is one bit time, and serial transfer trades speed for fewer lines.
Flashcards
Flashcard
Takes any value in a continuous range
Test your understanding
Question 1 of 5
A 3.3 V CMOS input has V_IL(max) = 0.8 V and V_IH(min) = 2.0 V. How does an input of 1.5 V read?
Question 2 of 5
A periodic pulse train has leading edges 40 µs apart, and each pulse lasts 10 µs. What are its frequency and duty cycle?
Question 3 of 5
Which statement about a negative-going pulse is correct?
Question 4 of 5
A 32-bit word is sent with a 100 MHz clock. How long does the transfer take serially, on one line, and in parallel, on 32 lines?
Question 5 of 5
In positive logic, how many different codes can a group of 6 bits represent?
