Ground Embedded KO Subscribe

Notes / Digital Logic

Combinational circuits: decoder, multiplexer, adder

Circuits whose output is set by the present inputs alone. Address decoding, pin-function selection and the ALU inside an MCU are all combinational circuits.

GROUND EMBEDDED · NOTEDigital Logic 03Combinational circuitsANDABY

A combinational circuit has no memory. When an input changes, the output follows after a short delay.

Decoder

Input 10Decoder2 → 4Y0 = 0Y1 = 0Y2 = 1
A 2-bit input turns on just one of four outputs. Used to make chip-select signals.

Turns an n-bit input into one of 2ⁿ outputs. A chip-select circuit that picks one of eight chips with 3 bits is typical. The CPU looking at an address and deciding "this is Flash, this is GPIO" is also a decoder.

Multiplexer

Inputs D0 ~ D3Select = 2Multiplexer4 → 1Output = D2
The select signal connects one of several inputs to the output.

Picks one of several inputs and sends it to the output. Alternate function (AF) selection, which chooses whether an MCU pin is used as GPIO, UART or PWM, is a multiplexer, and reading several channels with one ADC is thanks to an analog multiplexer.

RoadmapSee where this note sits in Digital Logic→

Adder

A half adder adds two bits to produce a sum and a carry; a full adder also adds the carry from the lower position. Chain 32 full adders and you have a 32-bit adder, the heart of the CPU's ALU.

Delay

Every gate has a propagation delay of a few ns, so the output can wobble briefly just after an input changes (a glitch). That is why real systems read only values that have settled, in step with a clock. This leads to the next step, sequential circuits.

FREE PDFGet the 3 free ebooksIf you want to keep reading this topic as one book: BLDC motor control, serial communication and sensors at book length. PDFs are in Korean.Get them free →