Lecture 4 - De Morgan and 3-bit parity
De Morgan's laws
{
"width":600,
"height":500,
"showToolbox":false,
"toolbox":[
],
"devices":[
{"type":"DC","id":"dev0","x":64,"y":112,"label":"DC"},
{"type":"Toggle","id":"dev1","x":168,"y":72,"label":"Toggle"},
{"type":"Toggle","id":"dev2","x":168,"y":144,"label":"Toggle"},
{"type":"NAND","id":"dev3","x":368,"y":80,"label":"NAND"},
{"type":"NOT","id":"dev4","x":216,"y":96,"label":"NOT"},
{"type":"NOT","id":"dev5","x":216,"y":168,"label":"NOT"},
{"type":"LED","id":"dev6","x":440,"y":160,"label":"LED"},
{"type":"LED","id":"dev7","x":440,"y":80,"label":"LED"},
{"type":"OR","id":"dev8","x":368,"y":160,"label":"OR"},
{"type":"LED","id":"dev9","x":440,"y":248,"label":"LED"},
{"type":"NOR","id":"dev10","x":376,"y":248,"label":"NOR"},
{"type":"DC","id":"dev11","x":72,"y":272,"label":"DC"},
{"type":"NOT","id":"dev12","x":216,"y":264,"label":"NOT"},
{"type":"Toggle","id":"dev13","x":168,"y":312,"label":"Toggle"},
{"type":"NOT","id":"dev14","x":216,"y":336,"label":"NOT"},
{"type":"AND","id":"dev15","x":376,"y":328,"label":"AND"},
{"type":"LED","id":"dev16","x":440,"y":328,"label":"LED"},
{"type":"Toggle","id":"dev17","x":168,"y":240,"label":"Toggle"}
],
"connectors":[
{"from":"dev1.in0","to":"dev0.out0"},
{"from":"dev2.in0","to":"dev0.out0"},
{"from":"dev3.in0","to":"dev1.out0"},
{"from":"dev3.in1","to":"dev2.out0"},
{"from":"dev4.in0","to":"dev1.out0"},
{"from":"dev5.in0","to":"dev2.out0"},
{"from":"dev6.in0","to":"dev8.out0"},
{"from":"dev7.in0","to":"dev3.out0"},
{"from":"dev8.in0","to":"dev4.out0"},
{"from":"dev8.in1","to":"dev5.out0"},
{"from":"dev9.in0","to":"dev10.out0"},
{"from":"dev10.in0","to":"dev17.out0"},
{"from":"dev10.in1","to":"dev13.out0"},
{"from":"dev12.in0","to":"dev17.out0"},
{"from":"dev13.in0","to":"dev11.out0"},
{"from":"dev14.in0","to":"dev13.out0"},
{"from":"dev15.in0","to":"dev12.out0"},
{"from":"dev15.in1","to":"dev14.out0"},
{"from":"dev16.in0","to":"dev15.out0"},
{"from":"dev17.in0","to":"dev11.out0"}
]
}
3-bit parity from the truth table
Example from class implementing a circuit from a truth table. Here
we have an OR of ANDs. Each AND (2 AND gates chained to give a 3 input
AND gate) corresponds to one row of the truth table. These are then ORed
together (using a network of OR gates to give a 4 input OR gate). Only
one of the rows will be true at once.
{
"width":700,
"height":400,
"showToolbox":false,
"toolbox":[
],
"devices":[
{"type":"DC","id":"dev0","x":16,"y":144,"label":"DC"},
{"type":"Toggle","id":"dev1","x":96,"y":248,"label":"C"},
{"type":"Toggle","id":"dev2","x":96,"y":48,"label":"A"},
{"type":"NOT","id":"dev3","x":136,"y":96,"label":"NOT"},
{"type":"NOT","id":"dev4","x":136,"y":296,"label":"NOT"},
{"type":"OR","numInputs":4,"id":"dev5","x":504,"y":160,"label":"OR"},
{"type":"AND","numInputs":3,"id":"dev6","x":344,"y":16,"label":"AND"},
{"type":"AND","numInputs":3,"id":"dev7","x":344,"y":296,"label":"AND"},
{"type":"AND","numInputs":3,"id":"dev8","x":344,"y":192,"label":"AND"},
{"type":"AND","numInputs":3,"id":"dev9","x":344,"y":104,"label":"AND"},
{"type":"LED","id":"dev10","x":552,"y":168,"label":"P"},
{"type":"Toggle","id":"dev11","x":96,"y":144,"label":"B"},
{"type":"NOT","id":"dev12","x":136,"y":184,"label":"NOT"}
],
"connectors":[
{"from":"dev1.in0","to":"dev0.out0"},
{"from":"dev2.in0","to":"dev0.out0"},
{"from":"dev3.in0","to":"dev2.out0"},
{"from":"dev4.in0","to":"dev1.out0"},
{"from":"dev5.in0","to":"dev6.out0"},
{"from":"dev5.in1","to":"dev9.out0"},
{"from":"dev5.in2","to":"dev8.out0"},
{"from":"dev5.in3","to":"dev7.out0"},
{"from":"dev6.in0","to":"dev3.out0"},
{"from":"dev6.in1","to":"dev12.out0"},
{"from":"dev6.in2","to":"dev4.out0"},
{"from":"dev7.in0","to":"dev2.out0"},
{"from":"dev7.in1","to":"dev11.out0"},
{"from":"dev7.in2","to":"dev4.out0"},
{"from":"dev8.in0","to":"dev2.out0"},
{"from":"dev8.in1","to":"dev12.out0"},
{"from":"dev8.in2","to":"dev1.out0"},
{"from":"dev9.in0","to":"dev3.out0"},
{"from":"dev9.in1","to":"dev11.out0"},
{"from":"dev9.in2","to":"dev1.out0"},
{"from":"dev10.in0","to":"dev5.out0"},
{"from":"dev11.in0","to":"dev0.out0"},
{"from":"dev12.in0","to":"dev11.out0"}
]
}
3 bit parity - an easier way
Here we have the same 3-bit parity function implemented using fewer
gates. Designing from the truth table does not always give the
easiest circuit!
{
"width":700,
"height":400,
"showToolbox":false,
"toolbox":[
],
"devices":[
{"type":"DC","id":"dev0","x":64,"y":160,"label":"DC"},
{"type":"EOR","id":"dev1","x":248,"y":112,"label":"EOR"},
{"type":"EOR","id":"dev2","x":336,"y":160,"label":"EOR"},
{"type":"Toggle","id":"dev3","x":168,"y":64,"label":"A"},
{"type":"NOT","id":"dev4","x":416,"y":160,"label":"NOT"},
{"type":"LED","id":"dev5","x":504,"y":160,"label":"P"},
{"type":"Toggle","id":"dev6","x":168,"y":160,"label":"B"},
{"type":"Toggle","id":"dev7","x":168,"y":248,"label":"C"}
],
"connectors":[
{"from":"dev1.in0","to":"dev3.out0"},
{"from":"dev1.in1","to":"dev6.out0"},
{"from":"dev2.in0","to":"dev1.out0"},
{"from":"dev2.in1","to":"dev7.out0"},
{"from":"dev3.in0","to":"dev0.out0"},
{"from":"dev4.in0","to":"dev2.out0"},
{"from":"dev5.in0","to":"dev4.out0"},
{"from":"dev6.in0","to":"dev0.out0"},
{"from":"dev7.in0","to":"dev0.out0"}
]
}
Sand box
Build your own circuits here
{
"width":700,
"height":500,
"showToolbox":true,
"toolbox":[
{"type":"In"},
{"type":"Out"},
{"type":"DC"},
{"type":"LED"},
{"type":"PushOff"},
{"type":"PushOn"},
{"type":"Toggle"},
{"type":"BUF"},
{"type":"NOT"},
{"type":"AND"},
{"type":"NAND"},
{"type":"OR"},
{"type":"NOR"},
{"type":"EOR"},
{"type":"ENOR"},
{"type":"OSC"},
{"type":"7seg"},
{"type":"16seg"},
{"type":"4bit7seg"},
{"type":"RotaryEncoder"},
{"type":"BusIn"},
{"type":"BusOut"},
{"type":"RS-FF"},
{"type":"JK-FF"},
{"type":"T-FF"},
{"type":"D-FF"},
{"type":"8bitCounter"},
{"type":"HalfAdder"},
{"type":"FullAdder"},
{"type":"4bitAdder"},
{"type":"2to4BinaryDecoder"},
{"type":"3to8BinaryDecoder"},
{"type":"4to16BinaryDecoder"}
],
"devices":[
{"type":"DC","id":"dev0","x":64,"y":160,"label":"DC"},
{"type":"EOR","id":"dev1","x":248,"y":112,"label":"EOR"},
{"type":"EOR","id":"dev2","x":336,"y":160,"label":"EOR"},
{"type":"Toggle","id":"dev3","x":168,"y":64,"label":"A"},
{"type":"NOT","id":"dev4","x":416,"y":160,"label":"NOT"},
{"type":"LED","id":"dev5","x":504,"y":160,"label":"P"},
{"type":"Toggle","id":"dev6","x":168,"y":160,"label":"B"},
{"type":"Toggle","id":"dev7","x":168,"y":248,"label":"C"}
],
"connectors":[
{"from":"dev1.in0","to":"dev3.out0"},
{"from":"dev1.in1","to":"dev6.out0"},
{"from":"dev2.in0","to":"dev1.out0"},
{"from":"dev2.in1","to":"dev7.out0"},
{"from":"dev3.in0","to":"dev0.out0"},
{"from":"dev4.in0","to":"dev2.out0"},
{"from":"dev5.in0","to":"dev4.out0"},
{"from":"dev6.in0","to":"dev0.out0"},
{"from":"dev7.in0","to":"dev0.out0"}
]
}