Building Blocks and Equality Comparators
On this page 4 headings
Start here Nobody builds a house one grain of sand at a time. Builders use bricks, doors and windows: ready-made parts. Circuit designers work the same way. Instead of placing every gate by hand, they use ready-made building blocks like comparators, decoders and multiplexers. This week you meet the most common ones.
A combinational building block is a group of gates that does one common job. It usually has tens to hundreds of transistors. (This size was once called MSI: Medium Scale Integration.)
Why use them? They hide the gate-level details. You only need to know what the block does, not how every gate inside is wired.
| Block | Its job in one line | Week |
|---|---|---|
| Comparator | Are two numbers equal? | 4 |
| Decoder | Turn an n-bit code into “exactly one line on” | 4 |
| Encoder | The opposite: turn “one line on” into a code | 4 |
| Multiplexer (MUX) | Pick one of many inputs and send it to the output | 4 |
| Full adder | Add bits | 5 |
| PLA | A programmable AND–OR grid for any function | 5 |
Question: are bits x and y the same?
| x | y | equal? | |
|---|---|---|---|
| 0 | 0 | 0 | 1 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 1 |
- XOR gives 1 when the bits are different.
- XNOR gives 1 when the bits are equal.
So a 1-bit equality comparator is just an XNOR gate.
Two numbers are equal only if every pair of matching bits is equal.
- Put one XNOR on each bit pair ( with with ).
- AND all the XNOR outputs together.
Lecture example — 11 vs 9 1011, 1001
Bit 3 2 1 0 A 1 0 1 1 B 1 0 0 1 XNOR 1 1 0 1 One XNOR gives 0 (bit 1 differs), so the AND gives 0 → A ≠ B.
Everyday example: checking a 4-digit door lock code. The lock opens only if every digit matches. One wrong digit and it stays shut. That’s the AND of all the “digit matches” checks.
In one line: Building blocks are ready-made gate groups. An equality comparator is one XNOR per bit, all ANDed together. Exam words: combinational building block, MSI, comparator, equality comparator, XNOR, N-bit comparison.
Which single gate is a 1-bit equality comparator?
XNOR (1 when both bits are equal).How many XNOR gates does an 8-bit equality comparator need?
8 (one per bit pair), plus an AND to join them.. What does the comparator output?
- All four XNORs give 1, so the AND gives 1.
