THE BINARY NUMBERING SYSTEM prepared by Burak Galip ASLAN ([email protected]) September, 2006.

22
THE BINARY NUMBERING SYSTEM prepared by Burak Galip ASLAN ([email protected]) September, 2006

Transcript of THE BINARY NUMBERING SYSTEM prepared by Burak Galip ASLAN ([email protected]) September, 2006.

Page 1: THE BINARY NUMBERING SYSTEM prepared by Burak Galip ASLAN (bga_76@yahoo.com) September, 2006.

THE BINARY NUMBERING SYSTEM

prepared by Burak Galip ASLAN ([email protected])

September, 2006

Page 2: THE BINARY NUMBERING SYSTEM prepared by Burak Galip ASLAN (bga_76@yahoo.com) September, 2006.

Information representation

Page 3: THE BINARY NUMBERING SYSTEM prepared by Burak Galip ASLAN (bga_76@yahoo.com) September, 2006.

Base 2 positional numbering

system

Decimal to binary conversion table

Page 4: THE BINARY NUMBERING SYSTEM prepared by Burak Galip ASLAN (bga_76@yahoo.com) September, 2006.

111001 ?

?23

Same amount of information in more number of digits in binary form

57

10111

Simple examples

Page 5: THE BINARY NUMBERING SYSTEM prepared by Burak Galip ASLAN (bga_76@yahoo.com) September, 2006.

Arithmetic overflow

1 1 11 1 1 1 1

integer storing capacity

1 1 11 1 1 1 11 1 11 1 1 1 1

2027

20215

0-255

0-6553567890?

Arithmetic overflow! Should be handled!

Page 6: THE BINARY NUMBERING SYSTEM prepared by Burak Galip ASLAN (bga_76@yahoo.com) September, 2006.

Sign-magnitude notation

1 1 11 1 1 1 12027 26

sign bit

1 0 00 1 0 1 1170?

- 86?

1

0 positive

negative

Interpretation?ball?

Page 7: THE BINARY NUMBERING SYSTEM prepared by Burak Galip ASLAN (bga_76@yahoo.com) September, 2006.

Negation

1 00 0 0 1 00 + 12

0 11 1 1 0 11

Take one’s complement

Add 1

1 01 1 1 0 01 - 12

This is two’s complement technique for negation

Page 8: THE BINARY NUMBERING SYSTEM prepared by Burak Galip ASLAN (bga_76@yahoo.com) September, 2006.

Binary addition

1 00 0 0 1 00 + 12

1 10 0 0 0 00 + 5

0 11 1 1 1 11 - 5

12 + (- 5)

1 10 0 0 0 10 + 7

Page 9: THE BINARY NUMBERING SYSTEM prepared by Burak Galip ASLAN (bga_76@yahoo.com) September, 2006.

Binary addition

1 10 0 0 0 00 + 5

1 00 0 0 1 00 + 12

1 01 1 1 0 01 - 12

5 + (- 12)

0 11 1 1 1 01 - ?

1 10 0 0 0 10

- 7

Page 10: THE BINARY NUMBERING SYSTEM prepared by Burak Galip ASLAN (bga_76@yahoo.com) September, 2006.

Binary multiplication and division

(- 3) X 2

6 / 3

http://courses.cs.vt.edu/~cs1104/BuildingBlocks/divide.010.html

Page 11: THE BINARY NUMBERING SYSTEM prepared by Burak Galip ASLAN (bga_76@yahoo.com) September, 2006.

Decimal to binary conversion

47 20 21 22 23 24 25 2615

1 0

7

1

3

1

1

1

0

1

47 1

46

23 1

22

11 1

10

5 1

4

2 01

0

1

http://www.math.grinnell.edu/~rebelsky/Courses/CS152/97F/Readings/student-binary.html

Page 12: THE BINARY NUMBERING SYSTEM prepared by Burak Galip ASLAN (bga_76@yahoo.com) September, 2006.

Storing text / code mapping

0 0 10 0 0 0 0

0 0 00 0 0 0 1

A

B

0 0 10 0 0 0 1 C

0 1 00 0 0 0 0 D

8-bit code representation

0 0 10 0 0 0 0 0 1 00 0 0 0 0A D

AD

Page 13: THE BINARY NUMBERING SYSTEM prepared by Burak Galip ASLAN (bga_76@yahoo.com) September, 2006.

ASCII coding standard

American Standard Code for Information Interchange

Page 14: THE BINARY NUMBERING SYSTEM prepared by Burak Galip ASLAN (bga_76@yahoo.com) September, 2006.

ASCII art

Page 15: THE BINARY NUMBERING SYSTEM prepared by Burak Galip ASLAN (bga_76@yahoo.com) September, 2006.

Reliability of binary representation

Why not decimal, octal or ternary computers?

Nature of electrical systems: bistability!

Reliability v.s. conversion time

Page 16: THE BINARY NUMBERING SYSTEM prepared by Burak Galip ASLAN (bga_76@yahoo.com) September, 2006.

Binary storage devices

Two stable energy states (for 0 and 1)

States separated by large energy barrier

Sense the state without destroying information

Switch states by applying energy

How about a light switch?

bulky and slow, but OK!

Page 17: THE BINARY NUMBERING SYSTEM prepared by Burak Galip ASLAN (bga_76@yahoo.com) September, 2006.

Binary storage devices

Magnetic core memories (1955 – 1975)

16 cm X 16 cm

each ring stores 1 bit

128 X 128 bits = 2 KB memory

each ring is ~ 1 mm

speed up to 1 MHz

non-volatile storage

Page 18: THE BINARY NUMBERING SYSTEM prepared by Burak Galip ASLAN (bga_76@yahoo.com) September, 2006.

Binary storage devices

Transistor memories

transistor

Integrated Circuit

extremely small

extremely fast

extremely cheap

Page 19: THE BINARY NUMBERING SYSTEM prepared by Burak Galip ASLAN (bga_76@yahoo.com) September, 2006.

Binary storage devices

IC: Integrated Circuits (1950’s)

SSI: Small-Scale Integration (1960’s) (10’s)

MSI: Medium-Scale Integration (1960’s) (100’s)

LSI: Large-Scale Integration (1970’s) (1000’s)

VLSI: Very-Large-Scale Integration (1980’s) (millions of transistors)

ULSI: Ultra-Large-Scale Integration (> 1M)

Attacking the complexity problem

Page 20: THE BINARY NUMBERING SYSTEM prepared by Burak Galip ASLAN (bga_76@yahoo.com) September, 2006.

WSI: Wafer-Scale Integration (1980’s)

Binary storage devices

Extreme intregration techniques

SOC: System-On-Chip Design (today)

FPGA: Field Programmable Gate Arrays (today) (ten thousands of LSI circuits)

Page 21: THE BINARY NUMBERING SYSTEM prepared by Burak Galip ASLAN (bga_76@yahoo.com) September, 2006.

Summary

• What is binary representation?

• Why is it suitable to be used in computers?

• How is it realized? (abstract level)

Page 22: THE BINARY NUMBERING SYSTEM prepared by Burak Galip ASLAN (bga_76@yahoo.com) September, 2006.

References

• An Invitation to Computer Science, 1st Edition (1995) (Schneider & Gersting) (Section 4.2)

• Wikipedia & Google

September, 2006