This presentation is the property of its rightful owner.
1 / 11

CS170 Computer Organization and Architecture I PowerPoint PPT Presentation

CS170 Computer Organization and Architecture I. Ayman Abdel-Hamid Department of Computer Science Old Dominion University Lecture 1: 8/27/2002. Outline. What is a computer? An overview of number systems Decimal Binary Octal Hexadecimal. Input. Output. A Computer. Processor. Tapes

CS170 Computer Organization and Architecture I

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript

CS170 Computer Organization and Architecture I

Ayman Abdel-Hamid

Department of Computer Science

Old Dominion University

Lecture 1: 8/27/2002

CS170 Fall 2002

Outline

• What is a computer?

• An overview of number systems

• Decimal

• Binary

• Octal

CS170 Fall 2002

Input

Output

A Computer

Processor

Tapes

Keyboard

Mouse

scanner

Display

Paper

Memory

Five classic components of a computer:

Input, Output, Memory, Data path, Control

Processor

CS170 Fall 2002

Computers are built on two key principles

• Both instructions and data are represented by numbers

• Instructions and data are stored in memory and are read and written as numbers

All computers use the binary number system (base 2)

(basic nature of electronic circuits ON/OFF, current flow/does not flow)

Machine alphabet has two letters “0”, “1”

Each letter is a binary digit “bit”. Byte is 8 bits

CS170 Fall 2002

Number Systems

• Numbers can be represented in any base (humans use base 10)

• Symbols for a number system of base B are 0, 1, 2, …, B –1

• decimal (base 10) 0, 1, 2, .., 9binary (base 2) 0, 1

• notation “numberB” (375 in decimal is written 37510, 1011 in binary is written 10112)

• Value of ith digit d is “d * Bi” where i starts from 0 and increases from right to left

2 1 0ipositional notation

3 7 5d

5 * 100=5

7 * 101=70

3 * 102=300

Three hundred and seventy five

CS170 Fall 2002

Conversion from binary to decimal

Convert 10112 to decimal

3 2 1 0i

1 0 1 1 d

= (1 * 20) + (1 * 21) + (0 * 22) + (1 *23)

= 1 + 2 + 0 + 8

= 1110

This process can be used for conversion from any number system to decimal (TRY convert 1238 to decimal)

CS170 Fall 2002

Conversion from decimal to binary

Step 1: divide value by 2 and record remainder

Step 2: as long as quotient not zero, continue to divide the newest quotient by 2 and record the remainder

Step 3: when obtain a zero as quotient, binary representation consists of remainders listed from right to left in order

Convert 1310 to binary

OperationQuotientremainder

13 by 2 6 1

6 by 2 3 0

3 by 2 1 1

1 by 2 0 1

1310 = 11012

CS170 Fall 2002

Conversion from decimal to binary

Previous approach can be used to convert from decimal to any number system

Convert 1310 to octal (octal is base 8)

OperationQuotientremainder

13 by 8 1 5

1 by 8 0 1

1310 = 158

158= (5 * 80) + (1 * 81) = 1310

CS170 Fall 2002

Other Number Systems

• Octal (base 8)

• Symbols (0, 1, 2, 3, 4, 5, 6, 7)

• Working with too long binary numbers is a problem

• Symbols (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F)

• Byte = 8 bits = 2 hex digits ( 1 hex digit is 4 bits)

CS170 Fall 2002

1101001110

11

0100

1110

416

Conversion from binary to hex

Convert 11010011102 to hex

Divide binary number into 4 bits groups from right to left

316

E16

34E16

CS170 Fall 2002

00000 0

10001 1

20010 2

30011 3

40100 4

50101 5

60110 6

70111 7

81000 8

91001 9

101010 A

111011 B

121100 C

131101 D

141110 E

151111 F

20 = 127 = 128

21 = 228 = 256

22 = 429 = 512

23 = 8210 = 1024

24 = 16211 = 2048

25 = 32212 = 4096

26 = 64213 = 8190

Kilo 210Tera240

Mega 220Peta250

Giga230

CS170 Fall 2002