# nand2 tetris 1and2

of 14 /14
1 B3 shuya The Elements of Computing System - .Boolean Logic .Boolean Arithmetic - B3 shuya

Author: shuya-osaki

Post on 13-Feb-2017

32 views

Category:

## Devices & Hardware

Embed Size (px)

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

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 Back-ground on how binary codes and Boolean arithmetic can be used.

The Specification section describes a succession ofadder chips.

9

• 3Usage of Simulator 10Environmental construction

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

2s complementmethod, also known asradix complement.

How to make 2s complement

0101

1010

1011

Reverse bit order

1s comlementmethod

2s comlementmethod

sum = LSB of a + b, carry = MSB of a + b