Computer Organization & Assembly Language...

40
1 CSE 2312 Lecture 2 Introduction to Computers Computer Organization & Assembly Language Programming

Transcript of Computer Organization & Assembly Language...

Page 1: Computer Organization & Assembly Language …ranger.uta.edu/~sjiang/CSE2312-fall-17/CSE2312_Lecture2.pdf7 Evolution of Multilevel Machines • Invention of microprogramming –1st

1

CSE 2312

Lecture 2 Introduction to Computers

Computer Organization &

Assembly Language Programming

Page 2: Computer Organization & Assembly Language …ranger.uta.edu/~sjiang/CSE2312-fall-17/CSE2312_Lecture2.pdf7 Evolution of Multilevel Machines • Invention of microprogramming –1st

2

Languages, Levels, Virtual Machines

A multilevel machine

Page 3: Computer Organization & Assembly Language …ranger.uta.edu/~sjiang/CSE2312-fall-17/CSE2312_Lecture2.pdf7 Evolution of Multilevel Machines • Invention of microprogramming –1st

3

Contemporary Multilevel Machines

A six-level computer. The support method for each level is indicated below it .

Page 4: Computer Organization & Assembly Language …ranger.uta.edu/~sjiang/CSE2312-fall-17/CSE2312_Lecture2.pdf7 Evolution of Multilevel Machines • Invention of microprogramming –1st

4

How to bridge gap?

• Idea

– Designing the L1 language including a new set of instructions that

is more convenient for people to use than those in built-in

machine instructions (L0 language)

• Solution: Translation

– Executing a program written in L1 is first to replace each L1’s

instruction with an equivalent sequence of L0’s instructions

– The computer executes the new L0 program instead of the

original L1 program

• Solution: Interpretation

– Write a program in L0 to take programs in L1 as input data

– Examine each instruction in turn and execute the equivalent

sequence of L0 instructions directly

Page 5: Computer Organization & Assembly Language …ranger.uta.edu/~sjiang/CSE2312-fall-17/CSE2312_Lecture2.pdf7 Evolution of Multilevel Machines • Invention of microprogramming –1st

5

Translation and Interpretation

• Similarity

– In both of them, the computer carried out instructions in L1 by

executing equivalent sequences of instructions in L0

• Difference

– In translation, the entire L1 program is converted to an L0

program. Then the new L0 program is loaded into the memory

and executed. During execution, the new L0 program runs and is

in control of computer

– In interpretation, after each L1 instruction is examined and

decoded, it is carried out immediately. The interpreter is in control

of computer. In this case, L1 program is just input data.

Page 6: Computer Organization & Assembly Language …ranger.uta.edu/~sjiang/CSE2312-fall-17/CSE2312_Lecture2.pdf7 Evolution of Multilevel Machines • Invention of microprogramming –1st

6

Hardware or Software?

Page 7: Computer Organization & Assembly Language …ranger.uta.edu/~sjiang/CSE2312-fall-17/CSE2312_Lecture2.pdf7 Evolution of Multilevel Machines • Invention of microprogramming –1st

7

Evolution of Multilevel Machines

• Invention of microprogramming

– 1st digit computer in 1940 only had ISA level and digital logic

level

– It made the digital logic level’ circuit very complicated,

unreliable, difficult to understand and build

– Microprogramming is designed (Wilkes,1951) as unchangeable

interpreter to execute the ISA-level programs by interpretation

– This enables fewer electronic circuits and hence enhance the

reliability

• Invention of operating system

– Earlier computers were open-shop, which meant the

programmers had to operate the computer by themselves

– First designed in 1960 to reduce the amount of operating

time/complexity by automating the operator’s job

Page 8: Computer Organization & Assembly Language …ranger.uta.edu/~sjiang/CSE2312-fall-17/CSE2312_Lecture2.pdf7 Evolution of Multilevel Machines • Invention of microprogramming –1st

8

Operating System Tasks

• Steps – Put the big green deck labeled

FORTRAN complier into the card reader, start

– Put his/her Fortran program into the card reader . Read it two times.

– The translation is completed and check if there exist errors. If no, the machine language is punched out into the cards

– Put the translated machine language cards and subroutine library deck in

– The program began executing. Programmers check problems while CPU is idle.

• sample job for the FMS operating system (IBM 709)

.

Page 9: Computer Organization & Assembly Language …ranger.uta.edu/~sjiang/CSE2312-fall-17/CSE2312_Lecture2.pdf7 Evolution of Multilevel Machines • Invention of microprogramming –1st

9

Evolution of Multilevel Machines

• Migration of functionality to microcode

– Add new instructions (hardware) by extending microprogram

– The added ones are not essentially but slightly faster than a

sequence of existing instructions

– Speeding up the particular activity

• Elimination of microprogramming

– Computer design had come full circle

– The microprogramming is too fat. The computer became

slower and slower

– Eliminating the microprogram vastly reduces the instruction set

– Having the remaining instructions be directly executed by

hardware

Page 10: Computer Organization & Assembly Language …ranger.uta.edu/~sjiang/CSE2312-fall-17/CSE2312_Lecture2.pdf7 Evolution of Multilevel Machines • Invention of microprogramming –1st

10

Milestones in Computer Architecture

• Some milestones in the development of the modern digital computer

Page 11: Computer Organization & Assembly Language …ranger.uta.edu/~sjiang/CSE2312-fall-17/CSE2312_Lecture2.pdf7 Evolution of Multilevel Machines • Invention of microprogramming –1st

11

Milestones in Computer Architecture (cont’d)

• Some milestones in the development of the digital computer

Page 12: Computer Organization & Assembly Language …ranger.uta.edu/~sjiang/CSE2312-fall-17/CSE2312_Lecture2.pdf7 Evolution of Multilevel Machines • Invention of microprogramming –1st

12

Computer Generations

• Zeroth Generation

– Mechanical Computers (1642 – 1945)

• First Generation

– Vacuum Tubes (1945 – 1955)

• Second Generation

– Transistors (1955 – 1965)

• Third Generation

– Integrated Circuits (1965 – 1980)

• Fourth Generation

– Very Large Scale Integration (1980 – ?)

Page 13: Computer Organization & Assembly Language …ranger.uta.edu/~sjiang/CSE2312-fall-17/CSE2312_Lecture2.pdf7 Evolution of Multilevel Machines • Invention of microprogramming –1st

13

Recalling: Original Von Neumann Architecture

• Model of a computer that used stores programs

– Both data and program stored in memory

– Allows the computer to be “re-programmed”

Page 14: Computer Organization & Assembly Language …ranger.uta.edu/~sjiang/CSE2312-fall-17/CSE2312_Lecture2.pdf7 Evolution of Multilevel Machines • Invention of microprogramming –1st

14

PDP-8 Innovation – Single Bus

The PDP-8 omnibus

Page 15: Computer Organization & Assembly Language …ranger.uta.edu/~sjiang/CSE2312-fall-17/CSE2312_Lecture2.pdf7 Evolution of Multilevel Machines • Invention of microprogramming –1st

15

IBM 360

The initial offering of the IBM product line.

Page 16: Computer Organization & Assembly Language …ranger.uta.edu/~sjiang/CSE2312-fall-17/CSE2312_Lecture2.pdf7 Evolution of Multilevel Machines • Invention of microprogramming –1st

16

Moore’s Law

• Moore’s Law

– Gordon Moore was an Inter Engineer

– An observation about improvements in hardware

– Predicts a 60-percent annual increase in the number of

transistors that can be put on a chip.

• Processor Speed

– Number of transistors on a chip double every 18 months

– Processors speed 2x every 18 months

• Memory Capacity

– 2x every 2 years

• Disk Capacity

– 2x every year

Page 17: Computer Organization & Assembly Language …ranger.uta.edu/~sjiang/CSE2312-fall-17/CSE2312_Lecture2.pdf7 Evolution of Multilevel Machines • Invention of microprogramming –1st

17

Applied to Transistors on a Chip

• Moore’s law

– Predicts a 60-percent annual increase in the number of

transistors that can be put on a chip.

– The data points given in this figure are memory sizes, in bits.

Page 18: Computer Organization & Assembly Language …ranger.uta.edu/~sjiang/CSE2312-fall-17/CSE2312_Lecture2.pdf7 Evolution of Multilevel Machines • Invention of microprogramming –1st

18

Clock Speed

Page 19: Computer Organization & Assembly Language …ranger.uta.edu/~sjiang/CSE2312-fall-17/CSE2312_Lecture2.pdf7 Evolution of Multilevel Machines • Invention of microprogramming –1st

19

Processor Performance

Page 20: Computer Organization & Assembly Language …ranger.uta.edu/~sjiang/CSE2312-fall-17/CSE2312_Lecture2.pdf7 Evolution of Multilevel Machines • Invention of microprogramming –1st

20

Memory Price

Page 21: Computer Organization & Assembly Language …ranger.uta.edu/~sjiang/CSE2312-fall-17/CSE2312_Lecture2.pdf7 Evolution of Multilevel Machines • Invention of microprogramming –1st

21

Hard Disk Drive Capacity

Page 22: Computer Organization & Assembly Language …ranger.uta.edu/~sjiang/CSE2312-fall-17/CSE2312_Lecture2.pdf7 Evolution of Multilevel Machines • Invention of microprogramming –1st

22

0.3 0.37587,000

0.91.2

451,8070.7

2560,000

2.5

11.66

1,666,666

1.25

37.5

5,000,000

0

500000

1000000

1500000

2000000

2500000

3000000

3500000

4000000

4500000

5000000

CP

U C

yc

les

1980 1985 1990 1995 2000

Year

Latencies of Cache, DRAM and Disk in CPU Cycles

SRAM Access Time DRAM Access Time Disk Seek Time

Unbalanced system improvements

Bryant and O’Hallaron, “Computer Systems: A Programmer’s Perspective”,

Prentice Hall, 2003.

The disks in 2000 are more than 57 times “SLOWER”

than their ancestors in 1980.

Page 23: Computer Organization & Assembly Language …ranger.uta.edu/~sjiang/CSE2312-fall-17/CSE2312_Lecture2.pdf7 Evolution of Multilevel Machines • Invention of microprogramming –1st

23

Different Computers

Greeting Card

(electronic music) $1

Electronic control in

cars $5~$10Game Computer

$50~$100

Personal Computer

$500~$1,000

Computer Servers $5,000 Mainframe Computer

$5,000,000

Page 24: Computer Organization & Assembly Language …ranger.uta.edu/~sjiang/CSE2312-fall-17/CSE2312_Lecture2.pdf7 Evolution of Multilevel Machines • Invention of microprogramming –1st

24

Different Computers

Page 25: Computer Organization & Assembly Language …ranger.uta.edu/~sjiang/CSE2312-fall-17/CSE2312_Lecture2.pdf7 Evolution of Multilevel Machines • Invention of microprogramming –1st

Microcontrollers

• Appliances

• Communications gear

• Computer peripherals

• Entertainment devices

• Imaging devices

• Medical devices

• Military weapon systems

• Shopping devices

• Toys

Page 26: Computer Organization & Assembly Language …ranger.uta.edu/~sjiang/CSE2312-fall-17/CSE2312_Lecture2.pdf7 Evolution of Multilevel Machines • Invention of microprogramming –1st

Radio-frequency identification (RFID)

Small RFID chips,

here compared to a

grain of rice

▪ RFID contains a tiny radio

transponder and a built-in

unique 128-bit number

▪ They are powered by the

incoming radio signal to

transmit their number back to

the antenna.

Page 27: Computer Organization & Assembly Language …ranger.uta.edu/~sjiang/CSE2312-fall-17/CSE2312_Lecture2.pdf7 Evolution of Multilevel Machines • Invention of microprogramming –1st

27

Personal Computer

• Printed circuit board

– The heart of every personal computer. (Figure: Intel D875PBZ

board)

1. Pentium 4 socket

2. 875P Support chip

3. Memory sockets

4. AGP connector

5. Disk interface

6. Gigabit Ethernet

7. Five PCI slots

8. USB 2.0 ports

9. Cooling technology

10. BIOS35

4

21

10

9

8

7

6

Page 28: Computer Organization & Assembly Language …ranger.uta.edu/~sjiang/CSE2312-fall-17/CSE2312_Lecture2.pdf7 Evolution of Multilevel Machines • Invention of microprogramming –1st

28

Representatives in Major Computer Families

• Pentium 4 by Intel

– Popular personal computer

• UltraSPARC III by Sun Microsystems

– Open architecture with many suppliers of parts and systems

– Aimed at high-end applications, such as large multiprocessor web

servers with dozens of CPUs and physical memories.

• The 8051 chip by Intel, used for embedded systems

– Use read-only memories for the program plus a small amount of

read-write memory, called RAM (Random Access Memory) for data

storage

– Cheaper price

Page 29: Computer Organization & Assembly Language …ranger.uta.edu/~sjiang/CSE2312-fall-17/CSE2312_Lecture2.pdf7 Evolution of Multilevel Machines • Invention of microprogramming –1st

29

Intel CPU Computer Family

Page 30: Computer Organization & Assembly Language …ranger.uta.edu/~sjiang/CSE2312-fall-17/CSE2312_Lecture2.pdf7 Evolution of Multilevel Machines • Invention of microprogramming –1st

30

The Intel Pentium 4 Chip

Page 31: Computer Organization & Assembly Language …ranger.uta.edu/~sjiang/CSE2312-fall-17/CSE2312_Lecture2.pdf7 Evolution of Multilevel Machines • Invention of microprogramming –1st

The Intel Core i7 Chip

The die is 21 by 21 mm and has 2.27 billion transistors.

Page 32: Computer Organization & Assembly Language …ranger.uta.edu/~sjiang/CSE2312-fall-17/CSE2312_Lecture2.pdf7 Evolution of Multilevel Machines • Invention of microprogramming –1st

32

Moore’s law for Intel CPU Chips.

Page 33: Computer Organization & Assembly Language …ranger.uta.edu/~sjiang/CSE2312-fall-17/CSE2312_Lecture2.pdf7 Evolution of Multilevel Machines • Invention of microprogramming –1st

33

Development Trends

• Advanced Architectures– Multi-core (more than 1 CPU on a chip)

• Performance Accelerators– Graphic chips (Xbox, Wii, nintendo)

– Probability Processing

• Embedded Computing– Processors in vending machines,

washer dryers, cars

• Cloud Computing– Computing as a utility

• Low Energy Design– Green is in

Dual Core CPU

Page 34: Computer Organization & Assembly Language …ranger.uta.edu/~sjiang/CSE2312-fall-17/CSE2312_Lecture2.pdf7 Evolution of Multilevel Machines • Invention of microprogramming –1st

Nvidia Tegra 2 system on a chip

Page 35: Computer Organization & Assembly Language …ranger.uta.edu/~sjiang/CSE2312-fall-17/CSE2312_Lecture2.pdf7 Evolution of Multilevel Machines • Invention of microprogramming –1st

35

Exercise

• Ex 1: TRUE OR FALSE, Why? – An interpreter converts programs in one language to another,

while a translator carries out a program instruction by instruction.

– Answer: F

– Reason: An translator converts programs in one language to another, while a interpreter carries out a program instruction by instruction.

• Ex 2: TRUE OR FALSE, Why? – L4 language (assembly language) is less convenient for

people to use than those in built-in machine instructions (L2).

– Answer: F

– Reason: L4 language is more convenient for people

Page 36: Computer Organization & Assembly Language …ranger.uta.edu/~sjiang/CSE2312-fall-17/CSE2312_Lecture2.pdf7 Evolution of Multilevel Machines • Invention of microprogramming –1st

36

Exercise

• Ex 3: TRUE OR FALSE, Why? – Hardware and software are functionally equivalent. Any function

done by one can, in principle, be done by the other.

– Answer: T

• Ex 4: Which of following statements are true for translation and Interpretation? – (a) In translation, the entire L1 program is converted to an L0

program.

– (b) In interpretation, after each L1 instruction is examined and decoded, it is carried out immediately.

– (c) Interpretation is more efficient than translation

– Answer: [a, b]

Page 37: Computer Organization & Assembly Language …ranger.uta.edu/~sjiang/CSE2312-fall-17/CSE2312_Lecture2.pdf7 Evolution of Multilevel Machines • Invention of microprogramming –1st

37

Exercise

• Ex 5: Which of following can be stored in the memory?

– (a) Data only

– (b) Program only

– (c) Both data and program

– (d) None of them

– Answer: [c]

Page 38: Computer Organization & Assembly Language …ranger.uta.edu/~sjiang/CSE2312-fall-17/CSE2312_Lecture2.pdf7 Evolution of Multilevel Machines • Invention of microprogramming –1st

38

Exercise

• Ex 6: Which of following is true according to Moore’s Law:

– (a) 2X processor speed improvement every 8 months.

– (b) 2X processor speed improvement every 18 months.

– (c) 4X processor speed improvement every 8 months.

– (d) 4X processor speed improvement every 18 months.

– Answer: [b]

Page 39: Computer Organization & Assembly Language …ranger.uta.edu/~sjiang/CSE2312-fall-17/CSE2312_Lecture2.pdf7 Evolution of Multilevel Machines • Invention of microprogramming –1st

39

Exercise

• Ex 7: Which of following is true in multilevel machine?

– (a) Instruction Set Architecture Level lays between Digital Logic Level and Microarchitecture Level.

– (b) Assembly Language Level lays between Instruction Set Architecture Level and Operating System Level

– (c) Operating System Level lays between Assembly Language Level and Instruction Set Architecture Level

– (d) Microarchitecture Level lays between Digital Logic Level and Instruction Set Architecture Level

– Answer: [c, d]

Page 40: Computer Organization & Assembly Language …ranger.uta.edu/~sjiang/CSE2312-fall-17/CSE2312_Lecture2.pdf7 Evolution of Multilevel Machines • Invention of microprogramming –1st

40

Exercise

• Ex 8: What is the key gap in computer design? How to bridge this gap?

– Answer:

– Human prefers natural language while it’s easy to use machine (binary) language for computers.

– Designing a high level language (L1) including a new set of instructions that is more convenient for people to use than those in built-in machine instructions (L0 language).