CSCI 255 Canonical Normal Form

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.

The Full Adder — Our example

As a truth table

AnBnCnCnp1Sn
00000
00101
01001
01110
10001
10110
11010
11111

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.

AND gate OR gate NOT gate NAND gate NOR gate