Tuesday, November 20, 2012

Boolean Logic : Activity 2 (with summary of ch-1)

DISCLAIMER: Meant to be read during coffee breaks as a summary // Author is not responsible for your frustration

chips - made of logic gates
and chips make up almost everything in computing science.

logic gates run on 0s and 1s - what we call as boolean and getting fidgetive with it called as boolean algebra.
Next, boolean functions operate on boolean i/p to give boolean o/p.

Truth table : we see all combinations of i/ps and their o/ps. From this we can form canonical representation.
This in turn proves that any boolean function can be formed out of 'And', "Or' and 'Not'.

Then we check out many boolean functions - And, Not, Constant, Equivalence, If then, Xor, Or, Nand, Nor.....
Nand function has an interesting property : And, Or and Not can be constructed from it. If you notice what we said about canonical representation, this means we can construct any boolean function from Nand alone.

Then we moved with gate symbols, interface and implementation.

Multiplexor (nick name: mux) has an extra i/p bit called selector to o/p one of the i/ps depending on the selector/selection-bit.
Demultiplexor (demux) is just the other way around.. the selection bit decides which o/p bit should give the i/p value as the o/p.

The project is meant to simplify our logic about the boolean logic :)

Activity 2 : Building NOT from primitive NAND

This goes in the .hdl file
// This file is part of the materials accompanying the book
// "The Elements of Computing Systems" by Nisan and Schocken,
// MIT Press. Book site: www.idc.ac.il/tecs
// File name: projects/01/Not.hdl

 * Not gate: out = not in

CHIP Not {
    IN in;
    OUT out;

    // Put your code here.
    Nand(a=in, b=in, out=out);


No comments:

Post a Comment