Skip to content
Digital logic (gates / K-map / truth table) templates

Physics — Logic: 2-to-4 decoder (core)

Two inputs and an inverter pair feeding four AND outputs.

Template previewDigital logic (gates / K-map / truth table)
2-to-4 decoderABG0G1Y0Y1Y2Y3O0O1O2O3Evaluated: 2 inputs, 4 outputs, 4 rows.O0 = ¬A · ¬BO1 = A · ¬BO2 = ¬A · B+ 1 further expressions

Make it your own.

title "2-to-4 decoder"
type gates
input A at (0,1)
input B at (0,4)
gate NOT G0 at (2,0)
gate NOT G1 at (2,5)
gate AND Y0 at (5,0)
gate AND Y1 at (5,2)
gate AND Y2 at (5,4)
gate AND Y3 at (5,6)
output O0 at (8,0)
output O1 at (8,2)
output O2 at (8,4)
output O3 at (8,6)
wire A G0
wire B G1
wire G0 Y0
wire G1 Y0
wire A Y1
wire G1 Y1
wire G0 Y2
wire B Y2
wire A Y3
wire B Y3
wire Y0 O0
wire Y1 O1
wire Y2 O2
wire Y3 O3