nand2 tetris 1and2

Post on 13-Feb-2017

53 Views

Category:

Devices & Hardware

1 Downloads

Preview:

Click to see full reader

TRANSCRIPT

1

B3 shuya

The Elements of Computing System- Ⅰ.Boolean Logic Ⅱ.Boolean Arithmetic -

B3 shuya

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 three-way And gate

3Logic Gate 5

1.1.2 Logic gateGate 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 7

Environmental constructionDownload

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

8

Ⅱ. Boolean Arithmetic

3Introduction

This chapter aims to make ALU.

All calculation on Computer executes by ALU.

The first section gives a brief Back-ground on how binary codes and Boolean arithmetic can be used.

The Specification section describes a succession ofadder chips.

9

3Usage of Simulator 10

Environmental constructionDownload

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

3Boolean Arithmetic 11

Binary NumbersUnlike the decimal system, which is founded on base 10,

the bi-nary 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 com-puters is called the

2’s complementmethod, also known asradix complement.

How to make 2’s complement

0101

1010

1011

Reverse bit order

1’s comlementmethod

add 1

2’s comlementmethod

3Adders 13

half 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 n-bit numbers

out = a + b

3ALU 14

Arithmetic 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.

top related