Top Banner
Digital Computers and Information Chapter 1 Mano and Kime
34
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Chapter 1 - Review

Digital Computersand Information

Chapter 1

Mano and Kime

Page 2: Chapter 1 - Review

Digital Computersand Information

• Digital Computers

• Number Systems

• Arithmetic Operations

• Decimal Codes

• Error Detection and Correction

Page 3: Chapter 1 - Review

Block Diagram of Computer

Page 4: Chapter 1 - Review

Memory

• ROMs and PROMs

• EPROMs, EEPROMs and Flash Memory

• Static RAMs and Dynamic RAMs

Page 5: Chapter 1 - Review

ROMs and PROMs

• ROM– Read-Only Memory

• PROM– Programmable Read-Only Memory

Page 6: Chapter 1 - Review

EPROMs, EEPROMs and Flash Memory

• EPROM– Erasable Programmable Read-Only Memory– Erase with ultraviolet light

• EEPROM– Electrically-Erasable Programmable Read-Only

Memory

• Flash Memory– Electrically-Erasable in bulk

Page 7: Chapter 1 - Review

RAMs• RAM

– Random-Access Memory– Read-Write Memory

• Static RAM– Needs 4 transistors per bit to make a latch– Data lost when power is turned off

• Dynamic RAM– One transistor per bit– Data stored as charge on a capacitor– Data must be continually refreshed

Page 8: Chapter 1 - Review

W8XMicrocontroller

mux4g

F C R M

Reg_Array

(mux2g)

ALU

N1

(stack8x16)rpoprpushReturn Stack

(mux2g)

(mux2g)

P reg

I Reg

Controller(w8x_control)

ProgramROM

P mux

R muxT mux

(reg)

(incrg)

R

M

TN

T

p_in

t_in

alu_out mux_out

alu_sel mux_sel

I

T

P

P1

iload

pload

pinc

tsel

rsel

psel

r_in

M

cregCout

C

M

T

sel0sel1sel2sel3

load

clr

clk

clk

clr

clr

clk

clk

clr

plus1P1

clr clkcload

Control UnitDatapath

Page 9: Chapter 1 - Review

The W8Z Microprocessor

reg_stack

Funit

TN2 N1N3

d0

y1cout

clr

clk

Rcode(3:0)

Fcode(4:0)

msel(5:0)

Wcontrol

Wrom

WPC

clk

clr

inc

M(15:8)M(7:0)

P

d1

ReturnStack

R

Pmux

Rmux

dual_mux8g

add2

sub1

ROM

RAM

T

T N1

y2

SW(1:8)

rsel(1:0)

psel

BTN(1:4)

rpush

rload

pselrsel

pload

DigReg

LDreg

dig3 dig1dig4 dig2

LD(1:8)

T

TN1

clrclk

rpush

rpop

pload

clrclk

rload

rdecclkclr

we

rpoprdec

ldloadclk

clr

clk

clr digload

P1

R

R1

RM1

p_in

r_in

T

T

Mmuxcnt1

clk clr

tog

c1

instr

tog

inc

ldload we

Page 10: Chapter 1 - Review

Digital Computerand Information

• Digital Computers

• Number Systems

• Arithmetic Operations

• Decimal Codes

• Error Detection and Correction

Page 11: Chapter 1 - Review

Powers of 2

Page 12: Chapter 1 - Review

Numbers with Different Bases

Page 13: Chapter 1 - Review

Number Systems

N = ...P3P2P1P0 . P-1P-2P-3...

= ... + P3b3 + P2b2 + P1b1 + P0b0

+ P-1b-1 + P-2b-2 + P-3b-3 + ...

375.1710 = 3 x 102 + 7 x 101 + 5 x 100

+ 1 x 10-1 + 7 x 10-2 = 300 + 70 + 5 + 0.1 + 0.07= 375.17

Page 14: Chapter 1 - Review

Number Systems

N = ...P3P2P1P0 . P-1P-2P-3...

= ... + P3b3 + P2b2 + P1b1 + P0b0

+ P-1b-1 + P-2b-2 + P-3b-3 + ...

1101.112 = 1 x 23 + 1 x 22 + 0 x 21 + 1 x 20 + 1 x 2-1 + 1 x 2-2

= 8 + 4 + 0 + 1 + 1/2 + 1/4= 13.7510

Binary

Page 15: Chapter 1 - Review

Number Systems

N = ...P3P2P1P0 . P-1P-2P-3...

= ... + P3b3 + P2b2 + P1b1 + P0b0

+ P-1b-1 + P-2b-2 + P-3b-3 + ...

1AB.616 = 1 x 162 + A x 161 + B x 160

+ 6 x 16-1 = 1 x 256 + 10 x 16 + 11 x 1 + 6/16 = 256 + 160 + 11 + 0.375 = 427.37510

Hex

Page 16: Chapter 1 - Review

Number Systems

N = ...P3P2P1P0 . P-1P-2P-3...

= ... + P3b3 + P2b2 + P1b1 + P0b0

+ P-1b-1 + P-2b-2 + P-3b-3 + ...

173.258 = 1 x 82 + 7 x 81 + 3 x 80

+ 2 x 8-1 + 5 x 8-2

= 1 x 64 + 7 x 8 + 3 x 1+ 2/8 + 5/64

= 64 + 56 + 3 + 0.25 + 0.078125= 123.32812510

Octal

Page 17: Chapter 1 - Review

Examples

Convert the following binary numbers to decimal:

1101001

10001011.011

10011010

Page 18: Chapter 1 - Review

Digital Computerand Information

• Digital Computers

• Number Systems

• Arithmetic Operations

• Decimal Codes

• Error Detection and Correction

Page 19: Chapter 1 - Review

Recall Full Adder Truth Table

0 0 0 0 00 0 1 1 00 1 0 1 00 1 1 0 11 0 0 1 01 0 1 0 11 1 0 0 11 1 1 1 1

Ci Ai Bi Si Ci+1

00 1 0 10 1 1 1

A

B

0

1

0

1

1

1

1

C

Final carry = 0

Page 20: Chapter 1 - Review

Binary Addition

0 0 1 1 0 1 0 10 0 0 1 1 0 0 1 0111

0

0

1

0

53+25 78

35+19 4E

Dec Hex

Binary

1001

1

0

0

Page 21: Chapter 1 - Review

Number System Conversions

• Hex, Binary, and Octal to Decimal

• Binary Hex

• Binary Octal

• Hex Octal

• Decimal to Hex, Octal, and Binary

Page 22: Chapter 1 - Review

Hex to Decimal8 7 C 9

x 16 128 + 7 135 x 16 2,160 + 12 2,172 x 1634,752 + 934,761

Page 23: Chapter 1 - Review

Binary Hex

0110 1010 1000 . 1111 0101 1100

6 A 8 . F 5 C

Page 24: Chapter 1 - Review

Binary Octal

011 010 101 000 . 111 101 011 100

3 2 5 0 . 7 5 3 4

Page 25: Chapter 1 - Review

Hex OctalGo through Binary

0110 1010 1000 . 1111 0101 1100

6 A 8 . F 5 C

011 010 101 000 . 111 101 011 100

3 2 5 0 . 7 5 3 4

Page 26: Chapter 1 - Review

Convert Decimal to any BaseInteger Part: Divide by the base,keep track of the remainder, and read up.

16 34,761 16 2,172 rem 9 16 135 rem 12 = C 16 8 rem 7 0 rem 8

Read up

34,76110 = 87C916

Page 27: Chapter 1 - Review

Convert Decimal to any Base

Fractional Part: Multiply by the base, keep track of the integer part, and read down.

0.78125 x 16 = 12.5 int = 12 = C

0.5 x 16 = 8.0 int = 8

Readdown

0.7812510 = 0.C816

Page 28: Chapter 1 - Review

Convert Decimal to any Base

Fractional Part: Multiply by the base, keep track of the integer part, and read down.0.1 x 2 = 0.2 int = 00.2 x 2 = 0.4 int = 00.4 x 2 = 0.8 int = 00.8 x 2 = 1.6 int = 10.6 x 2 = 1.2 int = 10.2 x 2 = 0.4 int = 00.4 x 2 = 0.8 int = 0

Readdown

0.110 = 0.000112

Page 29: Chapter 1 - Review

ExamplesConvert the following numbers from the given base to the other three bases listed in the table:

F3C7.A???

?326.5??

??10111101.101?

???369.3125

HexOctalBinaryDecimal

Page 30: Chapter 1 - Review

Binary Coded Decimal

Code decimal numbers using the binary digits, 0 - 9.That is, 0000 - 1001.Can NOT use the hex digits A - F.For example, the DECIMAL number 3582 wouldbe coded in BCD as

0011 0101 1000 0010While this looks like the HEX number 3582Hin BCD we interpret it as the DECIMAL number 3582.

Page 31: Chapter 1 - Review

BCD Addition

Binary

35H 00110101+47H 01000111 7CH 01111100

Decimal (BCD)

35H 00110101+47H 01000111 82H 10000010

0000 B0 35 MOV AL,35H ;AL = 35H0002 04 47 ADD AL,47H ;AL = AL+47H0004 27 DAA ;Decimal adjust

Page 32: Chapter 1 - Review

Digital Computerand Information

• Digital Computers

• Number Systems

• Arithmetic Operations

• Decimal Codes

• Error Detection and Correction

Page 33: Chapter 1 - Review

Error Detection and Correction

• Use of Parity Bit

- Extra bit included to make the total number of 1’s either even or odd. Refer to page : 22 for an example.

* If a parity error is detected at the receiving end, it can request for a retransmission.

Page 34: Chapter 1 - Review

More topics…

• Fixed and Floating point numbers – Refer to the ppt presentation on the course website.