Translating to a circuit
The simplest way to translate a Boolean function into a Boolean expression or a logic circuit is to use canonical normal form. Here’s some references about this process.
- Wikipedia article on canonical normal form
- University of Washington CSE 370 notes on canonical forms
- CSCI 255 spreadsheet for canonical forms
The Full Adder — Our example
As a truth table
An | Bn | Cn | Cnp1 | Sn |
---|---|---|---|---|
0 | 0 | 0 | 0 | 0 |
0 | 0 | 1 | 0 | 1 |
0 | 1 | 0 | 0 | 1 |
0 | 1 | 1 | 1 | 0 |
1 | 0 | 0 | 0 | 1 |
1 | 0 | 1 | 1 | 0 |
1 | 1 | 0 | 1 | 0 |
1 | 1 | 1 | 1 | 1 |
With C bit-operators
int An, Bn, Cn, Cnp1, Sn ; int tSum = An + Bn + Cn ; Sn = tSum & 0x1 ; Cnp1 = (tSum & 0x2) >> 1 ;
As a Verilog program
This is what you do in CSCI 320.
module fulladder( input An, input Bn, input Cn, output Cnp1, output Sn) ; assign {Cnp1, Sn} = An + Bn + Cn ; endmodule
Trying it out
Let’s do an example in class. We’ll translate the carry-out function into disjunctive canonocal normal form, often called sum of products form. Along the way we will introduce the AND, OR, NOT, NAND, and NOR logic gates.