nand2 tetris 1and2
Embed Size (px)
TRANSCRIPT

1
B3 shuya
The Elements of Computing System .Boolean Logic .Boolean Arithmetic 
B3 shuya
https://twitter.com/otimusya69https://twitter.com/otimusya69

2
. Boolean Logic

3Introduction
Every digital device is composed by chips. The component of chips is Logic Gate.
This chapter focus on Boolean Gatewhich is simple and physically represent bool function.
This chapter implement boolean gate by using simulator.I will show later how to use simulator.
3

3Boolean Algebra 4
1.1.1 Boolean Algebra
Boolean algebra uses binary values.
This is labeled true/false, 0/1, yes/no, on/off.
The expresion of Bool function
Truth Table
Boolean expression
Canonical representation
Truth Table
f(x, y, z) = (x+ y) zBoolean expression
Canonical expression
f(x, y, z) = xyz + xyz + xyz

Composite implementation of a threeway And gate
3Logic Gate 51.1.2 Logic gate
Gate is a physical device which implements function.
The simplest gates of all are made from tiny switching devices,
called transistors.
Primitive gate
Composite gateThis gate is combination of Primitive one.
This assembly called Logic design.

6
Usage of Simulator

3Usage of Simulator 7Environmental construction
Download
http://www.nand2tetris.org/software/mac_guide.html Setup
$ cd /usr/local/bin$ ln s ~/nand2tetris/tools/HardwareSimulator.sh HardwareSimulator$ chmod +x HardwareSimulator$ HardwareSimulator
Usage of SoftwareClick and load .hdl file. Click and load .tst file.
Run script
http://www.nand2tetris.org/software/mac_guide.html

8
. Boolean Arithmetic

3Introduction
This chapter aims to make ALU.
All calculation on Computer executes by ALU.
The first section gives a brief Background on how binary codes and Boolean arithmetic can be used.
The Specification section describes a succession ofadder chips.
9

3Usage of Simulator 10Environmental construction
Download
http://www.nand2tetris.org/software/mac_guide.html Setup
$ cd /usr/local/bin$ ln s ~/nand2tetris/tools/HardwareSimulator.sh HardwareSimulator$ chmod +x HardwareSimulator$ HardwareSimulator
Usage of SoftwareClick and load .hdl file. Click and load .tst file.
Run script
http://www.nand2tetris.org/software/mac_guide.html

3Boolean Arithmetic 11
Binary NumbersUnlike the decimal system, which is founded on base 10,
the binary system is founded on base.
Binary AdditionA pair of binary numbers can be added digit by digit from right to
left, the same method used in decimal addition.

3Boolean Arithmetic 12
Signed Binary NumbersThe method used by almost all computers is called the
2s complementmethod, also known asradix complement.
How to make 2s complement
0101
1010
1011
Reverse bit order
1s comlementmethod
add 1
2s comlementmethod

3Adders 13half adderThis is designed to add two bits
sum = LSB of a + b, carry = MSB of a + b
full adderThis is designed to add three bits
sum = LSB of a + b + c, carry = MSB of a + b + c
adderDesigned to add two nbit numbers
out = a + b

3ALU 14Arithmetic Logic UnitALU is component of PC. This executes boolean logic and arithmetic.
Previous gate is hold for any computer.
This section describes an ALU which is uniq one in this text.