CSC 284 · Introduction to Logic Design
Our notes
2 min readAnalogue and digital
An analogue quantity can take any value in a range: the temperature of a room, the voltage from a microphone, the position of a needle on a gauge. A digital quantity takes only a few separate values. In computers there are just two, written 0 and 1.
Why two levels?
- A circuit only has to tell "low" from "high", so small changes from noise or temperature do no harm.
- Two-state devices (a transistor on or off, a capacitor charged or not, a magnetised spot pointing one way or the other) are cheap, small and fast.
- Two-valued logic (true or false) has a complete mathematics, Boolean algebra, for designing circuits.
Logic levels
In a 5 V TTL circuit a voltage of 0 to 0.8 V counts as 0 and 2.0 to 5 V counts as 1; the gap between is not allowed. In 3.3 V circuits the levels are lower. Using high voltage for 1 is positive logic; the opposite is negative logic.
Bits, bytes and words
- Bit: one binary digit.
- Nibble: 4 bits. Byte: 8 bits (256 patterns).
- Word: the number of bits a processor handles at once (16, 32 or 64).
- n bits give 2ⁿ patterns: 10 bits give 1,024.
Everything is data
A bit pattern has no meaning until we choose a code. The byte 0100 0001 is the number 65, the letter "A" in ASCII, or part of a machine instruction, depending on how the program reads it. Instructions are stored in memory in the same way as numbers: this is the stored-program idea of von Neumann.
Converting between the two worlds
- ADC (analogue-to-digital converter): samples a signal at fixed times and gives each sample a binary number. An 8-bit ADC on a 0-5 V range has steps of 5 ÷ 256 ≈ 19.5 mV.
- DAC (digital-to-analogue converter): turns numbers back into voltages, as in a phone's headphone output.
Worked example
A 10-bit ADC measures 0 to 3.3 V. How big is one step, and what code does 1.65 V give?
- Step = 3.3 ÷ 1,024 ≈ 3.22 mV.
- 1.65 ÷ 3.3 × 1,024 = 512, so the code is 10 0000 0000.
Digital computers
A digital computer has a processor (control unit, arithmetic and logic unit, registers), memory, and input and output, joined by buses. Every part is built from the gates in later topics.
Exams usually ask
- Contrast analogue and digital systems with examples; give advantages of digital.
- How many patterns n bits give, and ADC step sizes.
Common mistake
Thinking a bit pattern has one fixed meaning: the same byte can be a number, a letter or an instruction.
Written by the UniHive team in our own words. Spotted a mistake? Tell us on WhatsApp.
Read
-
Digital Signals and Gates | Logic Gates | Electronics Textbook
(opens allaboutcircuits.com in a new tab)
-
Digital signal
(opens en.wikipedia.org in a new tab)
Wikipedia, Digital signal, CC BY-SA 4.0 · licence
-
Analog signal
(opens en.wikipedia.org in a new tab)
Wikipedia, Analog signal, CC BY-SA 4.0 · licence
-
MIT OpenCourseWare: 6.004 Computation Structures (Spring 2017)
Whole course: short lecture videos and worksheets on digital logic and computer design.
(opens ocw.mit.edu in a new tab)
MIT OpenCourseWare, MIT OpenCourseWare: 6.004 Computation Structures (Spring 2017), CC BY-NC-SA 4.0 · licence
Watch
-
Best pick What is an Analog Signal?
9 min · ≈ 41 MB · about ₦23
(opens youtube.com in a new tab)
-
Analog vs. digital signals | Waves | Middle school physics | Khan Academy
4 min · ≈ 18 MB · about ₦10
(opens youtube.com in a new tab)
-
Difference between Analog and Digital Signals | AddOhms #6
4 min · ≈ 18 MB · about ₦10
(opens youtube.com in a new tab)
-
Analog vs. Digital As Fast As Possible
6 min · ≈ 27 MB · about ₦15
(opens youtube.com in a new tab)
Practise
We link to free material and never copy it. Every link was opened by our team before it went up; video data is a rough guide at 360p.