IFT 211 · Digital Logic Design
Our notes
2 min readCombinational circuits
The output depends only on the present inputs: no memory. Design steps: state the problem, list inputs and outputs, write the truth table, minimise, draw the circuit.
Half adder
Adds two bits A and B.
- Sum S = A ⊕ B.
- Carry C = AB.
One XOR and one AND gate.
Full adder
Adds A, B and a carry in Cin.
- S = A ⊕ B ⊕ Cin.
- Cout = AB + Cin(A ⊕ B) (equal to AB + BCin + ACin).
It can be made from two half adders and an OR gate.
Worked example
A = 1, B = 1, Cin = 1: S = 1 ⊕ 1 ⊕ 1 = 1; Cout = 1. So 1 + 1 + 1 = 11₂ = 3. Correct.
Ripple-carry adder
Chain n full adders; each carry out feeds the next carry in. Simple, but slow: the last sum waits for the carry to ripple through every stage. With 16 stages at 10 ns per carry, the worst case is about 160 ns.
Carry look-ahead
Each stage computes generate G = AB and propagate P = A ⊕ B; all carries are worked out at once from these, so adding is much faster. Used inside processors.
Adder-subtractor
To compute A − B, invert each bit of B (XOR gates with a control line M = 1) and set the first carry in to 1: that adds the two's complement of B. With M = 0 the same circuit adds. Overflow (signed) = carry into the top bit XOR carry out of it.
Worked example
4-bit A = 0110 (6), B = 0011 (3), M = 1: B inverted = 1100, add 1 via carry in: 0110 + 1100 + 1 = 1 0011. Ignore the final carry: 0011 = 3. Correct.
Magnitude comparator
Compares A and B and gives A > B, A = B or A < B.
- 1-bit: equal = (A ⊕ B)' (XNOR); A > B = AB'; A < B = A'B.
- n-bit: A = B when every bit pair is equal; A > B is decided by the first (most significant) bit pair that differs. The 74LS85 is a 4-bit comparator that can be cascaded.
The ALU
An arithmetic logic unit combines an adder, logic operations (AND, OR, XOR) and a multiplexer that picks the result by an operation code. It is the heart of the processor's data path.
Exams usually ask
- Derive half and full adder equations from truth tables and draw them.
- Explain ripple-carry delay and how an adder-subtractor works.
Common mistake
Writing the full-adder carry as A ⊕ B ⊕ Cin: that is the sum, not the carry.
Written by the UniHive team in our own words. Spotted a mistake? Tell us on WhatsApp.
Read
-
Adder (electronics)
(opens en.wikipedia.org in a new tab)
Wikipedia, Adder (electronics), CC BY-SA 4.0 · licence
-
Half-Adder | Combinational Logic Functions | Electronics Textbook
(opens allaboutcircuits.com in a new tab)
-
Full-Adder | Combinational Logic Functions | Electronics Textbook
(opens allaboutcircuits.com in a new tab)
-
Digital comparator
(opens en.wikipedia.org in a new tab)
Wikipedia, Digital comparator, CC BY-SA 4.0 · licence
-
NPTEL: Switching Circuits and Logic Design (IIT Kharagpur, Prof. Indranil Sengupta)
Video lectures, many hours in all: watch on Wi-Fi where you can.
(opens nptel.ac.in in a new tab)
NPTEL, NPTEL: Switching Circuits and Logic Design (IIT Kharagpur, Prof. Indranil Sengupta), CC BY-NC-SA 4.0 · licence
-
NPTEL: Digital Circuits and Systems (IIT Madras, Prof. Shankar Balachandran)
Video lectures, many hours in all: watch on Wi-Fi where you can.
(opens nptel.ac.in in a new tab)
NPTEL, NPTEL: Digital Circuits and Systems (IIT Madras, Prof. Shankar Balachandran), CC BY-NC-SA 4.0 · licence
Watch
-
Best pick Half Adder
5 min · ≈ 23 MB · about ₦13
(opens youtube.com in a new tab)
-
Half Adder and Full Adder Explained | The Full Adder using Half Adder
14 min · ≈ 63 MB · about ₦35
(opens youtube.com in a new tab)
-
Combinational Devices 1: Half Adder and Full Adder
20 min · ≈ 90 MB · about ₦51
(opens youtube.com in a new tab)
-
Half Adders and Full Adders Beginner's Tutorial
17 min · ≈ 77 MB · about ₦43
(opens youtube.com in a new tab)
-
Mod-01 Lec-11 Adder & subtractor
1 h 21 min · ≈ 365 MB · about ₦205
(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.