1 / 11

# Lecture 1: 8 - 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

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.

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

Ayman Abdel-Hamid

Department of Computer Science

Old Dominion University

Lecture 1: 8/27/2002

CS170 Fall 2002

• What is a computer?

• An overview of number systems

• Decimal

• Binary

• Octal

CS170 Fall 2002

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

• 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, .., 9 binary (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 0 i positional notation

3 7 5 d

5 * 100 = 5

7 * 101 = 70

3 * 102 = 300

Three hundred and seventy five

CS170 Fall 2002

Convert 10112 to decimal

3 2 1 0 i

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

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

Operation Quotient remainder

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

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

Convert 1310 to octal (octal is base 8)

Operation Quotient remainder

13 by 8 1 5

1 by 8 0 1

1310 = 158

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

CS170 Fall 2002

• 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

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

0 0000 0

1 0001 1

2 0010 2

3 0011 3

4 0100 4

5 0101 5

6 0110 6

7 0111 7

8 1000 8

9 1001 9

10 1010 A

11 1011 B

12 1100 C

13 1101 D

14 1110 E

15 1111 F

20 = 1 27 = 128

21 = 2 28 = 256

22 = 4 29 = 512

23 = 8 210 = 1024

24 = 16 211 = 2048

25 = 32 212 = 4096

26 = 64 213 = 8190

Kilo 210 Tera 240

Mega 220 Peta 250

Giga 230

CS170 Fall 2002