SlideShare a Scribd company logo
1 of 56
Introduction
Microprocessor and Assembly Language
Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 2
Outline
 Welcome to Microprocessor and Assembly
Language
 High-Level, Assembly-, and Machine-Languages
 Components of a Computer System
 Chip Manufacturing Process
 Technology Improvements
 Programmer's View of a Computer System
Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 3
Welcome to Microprocessor and Assembly
Language
 Instructor: Dr. Sellami Ali
 Office:
 Office Phone:
 Office Hours:
 Email:
 sellami2003@hotmail.com
Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 4
Which Textbooks will be Used?
 Computer Organization & Design:
The Hardware/Software Interface
 Third Edition
 David Patterson and John Hennessy
 Morgan Kaufmann Publishers, 2005
 MIPS Assembly Language Programming
 Robert Britton
 Pearson Prentice Hall, 2004
 Supplement for Lab
 Read the textbooks in addition to slides
Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 5
Course Objectives
 Towards the end of this course, you should be able to …
 Describe the instruction set architecture of a MIPS processor
 Analyze, write, and test MIPS assembly language programs
 Describe organization/operation of integer & floating-point units
 Design the datapath and control of a single-cycle CPU
 Design the datapath/control of a pipelined CPU & handle
hazards
 Analyze the performance of processors and caches
Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 6
Grading Policy
 Assignments and Quizzes 10%
 Exam I 15%
 Exam II 15%
 Laboratory 10%
 Project 10%
 Final 40%
 Attendance will be taken regularly.
 Excuses for officially authorized absences must be presented no later
than two days following resumption of class attendance.
 Late assignments will be accepted (upto 3 days) but you will be
penalized 10% per each late day.
 A student caught cheating in any of the assignments will get 0 out of
10%.
 No makeup will be made for missing Quizzes or Exams.
Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 7
Course Topics
 Introduction
Introduction to computer architecture, assembly and machine
languages, components of a computer system, memory hierarchy,
instruction execution cycle, chip manufacturing process, technology
trends, programmer’s view of a computer system.
 Review of Data Representation
Binary and hexadecimal numbers, signed integers, binary and
hexadecimal addition and subtraction, carry and overflow,
characters and ASCII table.
 Instruction Set Architecture
Instruction set design, RISC design principles, MIPS instructions
and formats, registers, arithmetic instructions, bit manipulation, load
and store instructions, byte ordering, jump and conditional branch
instructions, addressing modes, pseudo instructions.
Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 8
Course Topics
 MIPS Assembly Language Programming
Assembly language tools, program template, directives, text, data,
and stack segments, defining data, arrays, and strings, array
indexing and traversal, translating expressions, if else statements,
loops, indirect jump and jump table, console input and output.
 Procedures and the Runtime Stack
Runtime stack and its applications, defining a procedure, procedure
calls and return address, nested procedure calls, passing
arguments in registers and on the stack, stack frames, value and
reference parameters, saving and restoring registers, local
variables on the stack.
 Interrupts
Software exceptions, syscall instruction, hardware interrupts,
interrupt processing and handler, MIPS coprocessor 0.
Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 9
Course Topics
 Integer Arithmetic and ALU design
Hardware adders, barrel shifter, multifunction ALU design, integer
multiplication, shift add multiplication hardware, Shift-subtract
division algorithm and hardware, MIPS integer multiply and divide
instructions, HI and LO registers.
 Floating-point arithmetic
Floating-point representation, IEEE 754 standard, FP addition and
multiplication, rounding, MIPS floating-point coprocessor and
instructions.
 CPU Performance
CPU performance and metrics, CPI and performance equation,
MIPS, Amdahl’s law.
Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 10
Course Topics
 Single-Cycle Datapath and Control Design
Designing a processor, register transfer, datapath components,
register file design, clocking methodology, control signals,
implementing the control unit, estimating longest delay.
 Pipelined Datapath and Control
Pipelining concepts, timing and performance, 5-stage MIPS
pipeline, pipelined datapath and control, pipeline hazards, data
hazards and forwarding, control hazards, branch prediction.
Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 11
Software Tools
 MIPS Simulators
 MARS: MIPS Assembly and Runtime Simulator
 Runs MIPS-32 assembly language programs
 Website: http://courses.missouristate.edu/KenVollmar/MARS/
 PCSPIM
 Also Runs MIPS-32 assembly language programs
 Website: http://www.cs.wisc.edu/~larus/spim.html
 CPU Design and Simulation Tool
 Logisim
 Educational tool for designing and simulating CPUs
 Website: http://ozark.hendrix.edu/~burch/logisim/
Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 12
What is “Computer Architecture” ?
 Computer Architecture =
Instruction Set Architecture +
Computer Organization
 Instruction Set Architecture (ISA)
 WHAT the computer does (logical view)
 Computer Organization
 HOW the ISA is implemented (physical view)
 We will study both in this course
Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 13
Next . . .
 Welcome to Microprocessor and Assembly
Language
 High-Level, Assembly-, and Machine-Languages
 Components of a Computer System
 Chip Manufacturing Process
 Technology Improvements
 Programmer's View of a Computer System
Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 14
Some Important Questions to Ask
 What is Assembly Language?
 What is Machine Language?
 How is Assembly related to a high-level language?
 Why Learn Assembly Language?
 What is an Assembler, Linker, and Debugger?
Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 15
A Hierarchy of Languages
Application Programs
High-Level Languages
Assembly Language
Machine Language
Hardware
High-Level Language
Low-Level Language
Machine independent
Machine specific
Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 16
Assembly and Machine Language
 Machine language
 Native to a processor: executed directly by hardware
 Instructions consist of binary code: 1s and 0s
 Assembly language
 Slightly higher-level language
 Readability of instructions is better than machine language
 One-to-one correspondence with machine language instructions
 Assemblers translate assembly to machine code
 Compilers translate high-level programs to machine code
 Either directly, or
 Indirectly via an assembler
Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 17
Compiler and Assembler
Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 18
Instructions and Machine Language
 Each command of a program is called an instruction (it
instructs the computer what to do).
 Computers only deal with binary data, hence the
instructions must be in binary format (0s and 1s) .
 The set of all instructions (in binary form) makes up the
computer's machine language. This is also referred to as
the instruction set.
Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 19
Instruction Fields
 Machine language instructions usually are made up of
several fields. Each field specifies different information
for the computer. The major two fields are:
 Opcode field which stands for operation code and it
specifies the particular operation that is to be performed.
 Each operation has its unique opcode.
 Operands fields which specify where to get the source
and destination operands for the operation specified by
the opcode.
 The source/destination of operands can be a constant, the
memory or one of the general-purpose registers.
Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 20
MIPS Assembly Language:
sll $2,$5, 2
add $2,$4,$2
lw $15,0($2)
lw $16,4($2)
sw $16,0($2)
sw $15,4($2)
jr $31
Compiler
Translating Languages
Program (C Language):
swap(int v[], int k) {
int temp;
temp = v[k];
v[k] = v[k+1];
v[k+1] = temp;
}
A statement in a high-level
language is translated
typically into several
machine-level instructions
MIPS Machine Language:
00051080
00821020
8C620000
8CF20004
ACF20000
AC620004
03E00008
Assembler
Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 21
Advantages of High-Level Languages
 Program development is faster
 High-level statements: fewer instructions to code
 Program maintenance is easier
 For the same above reasons
 Programs are portable
 Contain few machine-dependent details
 Can be used with little or no modifications on different machines
 Compiler translates to the target machine language
 However, Assembly language programs are not portable
Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 22
Why Learn Assembly Language?
 Many reasons:
 Accessibility to system hardware
 Space and time efficiency
 Writing a compiler for a high-level language
 Accessibility to system hardware
 Assembly Language is useful for implementing system software
 Also useful for small embedded system applications
 Space and Time efficiency
 Understanding sources of program inefficiency
 Tuning program performance
 Writing compact code
Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 23
Assembly Language Programming Tools
 Editor
 Allows you to create and edit assembly language source files
 Assembler
 Converts assembly language programs into object files
 Object files contain the machine instructions
 Linker
 Combines object files created by the assembler with link libraries
 Produces a single executable program
 Debugger
 Allows you to trace the execution of a program
 Allows you to view machine instructions, memory, and registers
Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 24
Assemble and Link Process
Source
File
Source
File
Source
File
Assembler
Object
File
Assembler
Object
File
Assembler
Object
File
Linker
Executable
File
Link
Libraries
A project may consist of multiple source files
Assembler translates each source file separately into an object file
Linker links all object files together with link libraries
Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 25
MARS Assembler and Simulator Tool
Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 26
Next . . .
 Welcome to Microprocessor and Assembly
Language
 High-Level, Assembly-, and Machine-Languages
 Components of a Computer System
 Chip Manufacturing Process
 Technology Improvements
 Programmer's View of a Computer System
Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 27
 Processor
 Datapath
 Control
 Memory & Storage
 Main Memory
 Disk Storage
 Input devices
 Output devices
 Bus: Interconnects processor to memory and I/O
 Network: newly added component for communication
Components of a Computer System
Computer
Memory
I/O Devices
Input
Output
B
U
S
Control
Datapath
Processor
Disk
Network
Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 28
Input Devices
Logical arrangement of keys
0 1 2 3
c d e f
8 9 a b
4 5 6 7
Mechanical switch
Spring
Key Cap
Contacts
Membrane switch
Conductor-coated membrane
Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 29
Output Devices
Laser printing
Rollers
Sheet of paper
Light from
optical
system
Toner
Rotating
drum
Cleaning of
excess toner
Charging
Heater
Fusing of toner
Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 30
Memory
 Ordered sequence of bytes
 The sequence number is called the memory address
 Byte addressable memory
 Each byte has a unique address
 Supported by almost all processors
 Physical address space
 Determined by the address bus width
 Pentium has a 32-bit address bus
 Physical address space = 4GB = 232 bytes
 Itanium with a 64-bit address bus can support
 Up to 264 bytes of physical address space
Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 31
Address Space
Address Space is
the set of memory
locations (bytes) that
can be addressed
Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 32
Address, Data, and Control Bus
 Address Bus
 Memory address is put on address bus
 If memory address = a bits then 2a
locations are addressed
 Data Bus: bi-directional bus
 Data can be transferred in both directions on the data bus
 Control Bus
 Signals control
transfer of data
 Read request
 Write request
 Done transfer
Memory
0
1
2
3
2a
– 1
. . .
read
write
done
data bus
address bus
Processor
d bits
a bits
Address Register
Data Register
Bus Control
Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 33
Memory Devices
 Volatile Memory Devices
 Data is lost when device is powered off
 RAM = Random Access Memory
 DRAM = Dynamic RAM
 1-Transistor cell + trench capacitor
 Dense but slow, must be refreshed
 Typical choice for main memory
 SRAM: Static RAM
 6-Transistor cell, faster but less dense than DRAM
 Typical choice for cache memory
 Non-Volatile Memory Devices
 Stores information permanently
 ROM = Read Only Memory
 Used to store the information required to startup the computer
 Many types: ROM, EPROM, EEPROM, and FLASH
 FLASH memory can be erased electrically in blocks
Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 34
Arm provides read/write
heads for all surfaces
The disk heads are
connected together and
move in conjunction
Track 0
Track 1
Recording area
Spindle
Direction of
rotation
Platter
Read/write head
Actuator
Arm
Track 2
A Magnetic disk consists of
a collection of platters
Provides a number of
recording surfaces
Magnetic Disk Storage
Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 35
Magnetic Disk Storage
Track 0
Track 1
Sector
Recording area
Spindle
Direction of
rotation
Platter
Read/write head
Actuator
Arm
Track 2
Disk Access Time =
Seek Time +
Rotation Latency +
Transfer Time
Seek Time: head movement to the
desired track (milliseconds)
Rotation Latency: disk rotation until
desired sector arrives under the head
Transfer Time: to transfer data
Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 36
Processor-Memory Performance Gap
 1980 – No cache in microprocessor
 1995 – Two-level cache on microprocessor
CPU: 55% per year
DRAM: 7% per year
1
10
100
1000 1980
1981
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
1982
Processor-Memory
Performance Gap:
(grows 50% per year)
Performance
“Moore’s Law”
Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 37
The Need for a Memory Hierarchy
 Widening speed gap between CPU and main memory
 Processor operation takes less than 1 ns
 Main memory requires more than 50 ns to access
 Each instruction involves at least one memory access
 One memory access to fetch the instruction
 A second memory access for load and store instructions
 Memory bandwidth limits the instruction execution rate
 Cache memory can help bridge the CPU-memory gap
 Cache memory is small in size but fast
Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 38
Typical Memory Hierarchy
 Registers are at the top of the hierarchy
 Typical size < 1 KB
 Access time < 0.5 ns
 Level 1 Cache (8 – 64 KB)
 Access time: 0.5 – 1 ns
 L2 Cache (512KB – 8MB)
 Access time: 2 – 10 ns
 Main Memory (1 – 2 GB)
 Access time: 50 – 70 ns
 Disk Storage (> 200 GB)
 Access time: milliseconds
Microprocessor
Registers
L1 Cache
L2 Cache
Memory
Disk, Tape, etc
Memory Bus
I/O Bus
Faster
Bigger
Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 39
Processor
 Datapath: part of a processor that executes instructions
 Control: generates control signals for each instruction
A
L
U
Registers
Instruction
Program
Counter
Instruction
Cache
Next Program
Counter
Data
Cache
Control
Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 40
Datapath Components
 Program Counter (PC)
 Contains address of instruction to be fetched
 Next Program Counter: computes address of next instruction
 Instruction Register (IR)
 Stores the fetched instruction
 Instruction and Data Caches
 Small and fast memory containing most recent instructions/data
 Register File
 General-purpose registers used for intermediate computations
 ALU = Arithmetic and Logic Unit
 Executes arithmetic and logic instructions
 Buses
 Used to wire and interconnect the various components
Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 41
Fetch instruction
Compute address of next instruction
Generate control signals for instruction
Read operands from registers
Compute result value
Writeback result in a register
Fetch - Execute Cycle
Instruction Decode
Instruction Fetch
Execute
Writeback Result
Infinite
Cycle
implemented
in
Hardware
Memory Access Read or write memory (load/store)
Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 42
Next . . .
 Welcome to Microprocessor and Assembly
Language
 Assembly-, Machine-, and High-Level Languages
 Components of a Computer System
 Chip Manufacturing Process
 Technology Improvements
 Programmer's View of a Computer System
Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 43
Chip Manufacturing Process
Silicon ingot
Slicer
Blank wafers
20 to 30 processing steps
8-12 in diameter
12-24 in long
< 0.1 in thick
Patterned wafer
Dicer
Individual dies
Die
Tester
Tested dies
Bond die to
package
Packaged dies
Part
Tester
Tested Packaged dies
Ship to
Customers
Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 44
Wafer of Pentium 4 Processors
 8 inches (20 cm) in diameter
 Die area is 250 mm2
 About 16 mm per side
 55 million transistors per die
 0.18 μm technology
 Size of smallest transistor
 Improved technology uses
 0.13 μm and 0.09 μm
 Dies per wafer = 169
 When yield = 100%
 Number is reduced after testing
 Rounded dies at boundary are useless
Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 45
Inside the Pentium 4 Processor Chip
Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 46
Next . . .
 Welcome to Microprocessor and Assembly
Language
 Assembly-, Machine-, and High-Level Languages
 Components of a Computer System
 Chip Manufacturing Process
 Technology Improvements
 Programmer's View of a Computer System
Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 47
Technology Improvements
 Vacuum tube → transistor → IC → VLSI
 Processor
 Transistor count: about 30% to 40% per year
 Memory
 DRAM capacity: about 60% per year (4x every 3 yrs)
 Cost per bit: decreases about 25% per year
 Disk
 Capacity: about 60% per year
 Opportunities for new applications
 Better organizations and designs
Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 48
Growth of Capacity per DRAM Chip
 DRAM capacity quadrupled almost every 3 years
 60% increase per year, for 20 years
Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 49
Workstation Performance
More than 1000 times
improvement between
1987 and 2003
Improvement is between
50% and 60% per year
Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 50
Microprocessor Sales (1998 – 2002)
 ARM processor
sales exceeded Intel
IA-32 processors,
which came second
 ARM processors
are used mostly in
cellular phones
 Most processors
today are embedded
in cell phones, video
games, digital TVs,
PDAs, and a variety
of consumer devices
Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 51
Microprocessor Sales – cont'd
Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 52
Next . . .
 Welcome to Microprocessor and Assembly
Language
 Assembly-, Machine-, and High-Level Languages
 Components of a Computer System
 Chip Manufacturing Process
 Technology Improvements
 Programmer's View of a Computer System
Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 53
Programmer’s View of a Computer System
Application Programs
High-Level Language
Assembly Language
Operating System
Instruction Set
Architecture
Microarchitecture
Physical Design
Level 0
Level 1
Level 2
Level 3
Level 4
Level 5
Increased level
of abstraction
Each level hides
the details of the
level below it
Software
Hardware
Interface
SW & HW
Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 54
Programmer's View – 2
 Application Programs (Level 5)
 Written in high-level programming languages
 Such as Java, C++, Pascal, Visual Basic . . .
 Programs compile into assembly language level (Level 4)
 Assembly Language (Level 4)
 Instruction mnemonics are used
 Have one-to-one correspondence to machine language
 Calls functions written at the operating system level (Level 3)
 Programs are translated into machine language (Level 2)
 Operating System (Level 3)
 Provides services to level 4 and 5 programs
 Translated to run at the machine instruction level (Level 2)
Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 55
Programmer's View – 3
 Instruction Set Architecture (Level 2)
 Interface between software and hardware
 Specifies how a processor functions
 Machine instructions, registers, and memory are exposed
 Machine language is executed by Level 1 (microarchitecture)
 Microarchitecture (Level 1)
 Controls the execution of machine instructions (Level 2)
 Implemented by digital logic
 Physical Design (Level 0)
 Implements the microarchitecture
 Physical layout of circuits on a chip
Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 56
Course Roadmap
 Instruction set architecture (Chapter 2)
 MIPS Assembly Language Programming (Chapter 2)
 Computer arithmetic (Chapter 3)
 Performance issues (Chapter 4)
 Constructing a processor (Chapter 5)
 Pipelining to improve performance (Chapter 6)
 Memory and caches (Chapter 7)
Key to obtain a good grade: read the textbook!

More Related Content

Similar to 2_Unit1_1-1.ppt

Design and development of a 5-stage Pipelined RISC processor based on MIPS
Design and development of a 5-stage Pipelined RISC processor based on MIPSDesign and development of a 5-stage Pipelined RISC processor based on MIPS
Design and development of a 5-stage Pipelined RISC processor based on MIPSIRJET Journal
 
UNIT-III EMBEDDED FIRMWARE DESIGNEmbedded Firmware design
UNIT-III  EMBEDDED FIRMWARE DESIGNEmbedded Firmware designUNIT-III  EMBEDDED FIRMWARE DESIGNEmbedded Firmware design
UNIT-III EMBEDDED FIRMWARE DESIGNEmbedded Firmware designSattiBabu16
 
Microprocessor and Microcontroller Based Systems.ppt
Microprocessor and Microcontroller Based Systems.pptMicroprocessor and Microcontroller Based Systems.ppt
Microprocessor and Microcontroller Based Systems.pptTALHARIAZ46
 
Evaluation of morden computer & system attributes in ACA
Evaluation of morden computer &  system attributes in ACAEvaluation of morden computer &  system attributes in ACA
Evaluation of morden computer & system attributes in ACAPankaj Kumar Jain
 
1. Programming in C - Introduction.pdf
1. Programming in C - Introduction.pdf1. Programming in C - Introduction.pdf
1. Programming in C - Introduction.pdfhydyc
 
Architectures and operating systems
Architectures and operating systemsArchitectures and operating systems
Architectures and operating systemsHiran Kanishka
 
Computer System Architecture Lecture Note 1: introduction
Computer System Architecture Lecture Note 1: introductionComputer System Architecture Lecture Note 1: introduction
Computer System Architecture Lecture Note 1: introductionBudditha Hettige
 
computer programing and utilization
computer programing and utilizationcomputer programing and utilization
computer programing and utilizationTushar Limbasiya
 
M1- IT Tools & Application.docx
M1- IT Tools & Application.docxM1- IT Tools & Application.docx
M1- IT Tools & Application.docxssuser3940ac
 
CS304PC:Computer Organization and Architecture Session 30 RISC.pptx
CS304PC:Computer Organization and Architecture Session 30 RISC.pptxCS304PC:Computer Organization and Architecture Session 30 RISC.pptx
CS304PC:Computer Organization and Architecture Session 30 RISC.pptxAsst.prof M.Gokilavani
 
Machine Level Language
Machine Level LanguageMachine Level Language
Machine Level LanguageSundar Acharya
 

Similar to 2_Unit1_1-1.ppt (20)

Chapter_01.pptx
Chapter_01.pptxChapter_01.pptx
Chapter_01.pptx
 
Design and development of a 5-stage Pipelined RISC processor based on MIPS
Design and development of a 5-stage Pipelined RISC processor based on MIPSDesign and development of a 5-stage Pipelined RISC processor based on MIPS
Design and development of a 5-stage Pipelined RISC processor based on MIPS
 
UNIT-III EMBEDDED FIRMWARE DESIGNEmbedded Firmware design
UNIT-III  EMBEDDED FIRMWARE DESIGNEmbedded Firmware designUNIT-III  EMBEDDED FIRMWARE DESIGNEmbedded Firmware design
UNIT-III EMBEDDED FIRMWARE DESIGNEmbedded Firmware design
 
Microprocessor and Microcontroller Based Systems.ppt
Microprocessor and Microcontroller Based Systems.pptMicroprocessor and Microcontroller Based Systems.ppt
Microprocessor and Microcontroller Based Systems.ppt
 
Evaluation of morden computer & system attributes in ACA
Evaluation of morden computer &  system attributes in ACAEvaluation of morden computer &  system attributes in ACA
Evaluation of morden computer & system attributes in ACA
 
Co question 2008
Co question 2008Co question 2008
Co question 2008
 
1. Programming in C - Introduction.pdf
1. Programming in C - Introduction.pdf1. Programming in C - Introduction.pdf
1. Programming in C - Introduction.pdf
 
Architectures and operating systems
Architectures and operating systemsArchitectures and operating systems
Architectures and operating systems
 
01-BasicConcepts__.ppt
01-BasicConcepts__.ppt01-BasicConcepts__.ppt
01-BasicConcepts__.ppt
 
Computer System Architecture Lecture Note 1: introduction
Computer System Architecture Lecture Note 1: introductionComputer System Architecture Lecture Note 1: introduction
Computer System Architecture Lecture Note 1: introduction
 
computer programing and utilization
computer programing and utilizationcomputer programing and utilization
computer programing and utilization
 
CS6303 Computer Architecture.pdf
CS6303 Computer Architecture.pdfCS6303 Computer Architecture.pdf
CS6303 Computer Architecture.pdf
 
M1- IT Tools & Application.docx
M1- IT Tools & Application.docxM1- IT Tools & Application.docx
M1- IT Tools & Application.docx
 
CS304PC:Computer Organization and Architecture Session 30 RISC.pptx
CS304PC:Computer Organization and Architecture Session 30 RISC.pptxCS304PC:Computer Organization and Architecture Session 30 RISC.pptx
CS304PC:Computer Organization and Architecture Session 30 RISC.pptx
 
Micro Assembler
Micro AssemblerMicro Assembler
Micro Assembler
 
Machine Level Language
Machine Level LanguageMachine Level Language
Machine Level Language
 
ERTS_Unit 1_PPT.pdf
ERTS_Unit 1_PPT.pdfERTS_Unit 1_PPT.pdf
ERTS_Unit 1_PPT.pdf
 
CS6303 - Computer Architecture
CS6303 - Computer ArchitectureCS6303 - Computer Architecture
CS6303 - Computer Architecture
 
Mips architecture
Mips architectureMips architecture
Mips architecture
 
MEGHA22[1].pdf
MEGHA22[1].pdfMEGHA22[1].pdf
MEGHA22[1].pdf
 

More from KamalZeghdar

Chapitre 3 Modbus.pptx
Chapitre 3 Modbus.pptxChapitre 3 Modbus.pptx
Chapitre 3 Modbus.pptxKamalZeghdar
 
cour PIC16F877.pptx
cour PIC16F877.pptxcour PIC16F877.pptx
cour PIC16F877.pptxKamalZeghdar
 
cours-gratuit.com--pas-a-pas-vers-l-assembleur-par-lord-noteworthyid045.pdf
cours-gratuit.com--pas-a-pas-vers-l-assembleur-par-lord-noteworthyid045.pdfcours-gratuit.com--pas-a-pas-vers-l-assembleur-par-lord-noteworthyid045.pdf
cours-gratuit.com--pas-a-pas-vers-l-assembleur-par-lord-noteworthyid045.pdfKamalZeghdar
 
cours-gratuit.com--system1id048.pdf
cours-gratuit.com--system1id048.pdfcours-gratuit.com--system1id048.pdf
cours-gratuit.com--system1id048.pdfKamalZeghdar
 
cours-gratuit.com--pas-a-pas-vers-l-assembleur-par-lord-noteworthyid045.pdf
cours-gratuit.com--pas-a-pas-vers-l-assembleur-par-lord-noteworthyid045.pdfcours-gratuit.com--pas-a-pas-vers-l-assembleur-par-lord-noteworthyid045.pdf
cours-gratuit.com--pas-a-pas-vers-l-assembleur-par-lord-noteworthyid045.pdfKamalZeghdar
 

More from KamalZeghdar (7)

003404788(1).pptx
003404788(1).pptx003404788(1).pptx
003404788(1).pptx
 
Lecture6.pptx
Lecture6.pptxLecture6.pptx
Lecture6.pptx
 
Chapitre 3 Modbus.pptx
Chapitre 3 Modbus.pptxChapitre 3 Modbus.pptx
Chapitre 3 Modbus.pptx
 
cour PIC16F877.pptx
cour PIC16F877.pptxcour PIC16F877.pptx
cour PIC16F877.pptx
 
cours-gratuit.com--pas-a-pas-vers-l-assembleur-par-lord-noteworthyid045.pdf
cours-gratuit.com--pas-a-pas-vers-l-assembleur-par-lord-noteworthyid045.pdfcours-gratuit.com--pas-a-pas-vers-l-assembleur-par-lord-noteworthyid045.pdf
cours-gratuit.com--pas-a-pas-vers-l-assembleur-par-lord-noteworthyid045.pdf
 
cours-gratuit.com--system1id048.pdf
cours-gratuit.com--system1id048.pdfcours-gratuit.com--system1id048.pdf
cours-gratuit.com--system1id048.pdf
 
cours-gratuit.com--pas-a-pas-vers-l-assembleur-par-lord-noteworthyid045.pdf
cours-gratuit.com--pas-a-pas-vers-l-assembleur-par-lord-noteworthyid045.pdfcours-gratuit.com--pas-a-pas-vers-l-assembleur-par-lord-noteworthyid045.pdf
cours-gratuit.com--pas-a-pas-vers-l-assembleur-par-lord-noteworthyid045.pdf
 

Recently uploaded

Keppel Ltd. 1Q 2024 Business Update Presentation Slides
Keppel Ltd. 1Q 2024 Business Update  Presentation SlidesKeppel Ltd. 1Q 2024 Business Update  Presentation Slides
Keppel Ltd. 1Q 2024 Business Update Presentation SlidesKeppelCorporation
 
8447779800, Low rate Call girls in Saket Delhi NCR
8447779800, Low rate Call girls in Saket Delhi NCR8447779800, Low rate Call girls in Saket Delhi NCR
8447779800, Low rate Call girls in Saket Delhi NCRashishs7044
 
Independent Call Girls Andheri Nightlaila 9967584737
Independent Call Girls Andheri Nightlaila 9967584737Independent Call Girls Andheri Nightlaila 9967584737
Independent Call Girls Andheri Nightlaila 9967584737Riya Pathan
 
2024 Numerator Consumer Study of Cannabis Usage
2024 Numerator Consumer Study of Cannabis Usage2024 Numerator Consumer Study of Cannabis Usage
2024 Numerator Consumer Study of Cannabis UsageNeil Kimberley
 
Call Girls In Radisson Blu Hotel New Delhi Paschim Vihar ❤️8860477959 Escorts...
Call Girls In Radisson Blu Hotel New Delhi Paschim Vihar ❤️8860477959 Escorts...Call Girls In Radisson Blu Hotel New Delhi Paschim Vihar ❤️8860477959 Escorts...
Call Girls In Radisson Blu Hotel New Delhi Paschim Vihar ❤️8860477959 Escorts...lizamodels9
 
MAHA Global and IPR: Do Actions Speak Louder Than Words?
MAHA Global and IPR: Do Actions Speak Louder Than Words?MAHA Global and IPR: Do Actions Speak Louder Than Words?
MAHA Global and IPR: Do Actions Speak Louder Than Words?Olivia Kresic
 
8447779800, Low rate Call girls in Tughlakabad Delhi NCR
8447779800, Low rate Call girls in Tughlakabad Delhi NCR8447779800, Low rate Call girls in Tughlakabad Delhi NCR
8447779800, Low rate Call girls in Tughlakabad Delhi NCRashishs7044
 
Ten Organizational Design Models to align structure and operations to busines...
Ten Organizational Design Models to align structure and operations to busines...Ten Organizational Design Models to align structure and operations to busines...
Ten Organizational Design Models to align structure and operations to busines...Seta Wicaksana
 
Call Girls in DELHI Cantt, ( Call Me )-8377877756-Female Escort- In Delhi / Ncr
Call Girls in DELHI Cantt, ( Call Me )-8377877756-Female Escort- In Delhi / NcrCall Girls in DELHI Cantt, ( Call Me )-8377877756-Female Escort- In Delhi / Ncr
Call Girls in DELHI Cantt, ( Call Me )-8377877756-Female Escort- In Delhi / Ncrdollysharma2066
 
Kenya Coconut Production Presentation by Dr. Lalith Perera
Kenya Coconut Production Presentation by Dr. Lalith PereraKenya Coconut Production Presentation by Dr. Lalith Perera
Kenya Coconut Production Presentation by Dr. Lalith Pereraictsugar
 
FULL ENJOY Call girls in Paharganj Delhi | 8377087607
FULL ENJOY Call girls in Paharganj Delhi | 8377087607FULL ENJOY Call girls in Paharganj Delhi | 8377087607
FULL ENJOY Call girls in Paharganj Delhi | 8377087607dollysharma2066
 
Islamabad Escorts | Call 03274100048 | Escort Service in Islamabad
Islamabad Escorts | Call 03274100048 | Escort Service in IslamabadIslamabad Escorts | Call 03274100048 | Escort Service in Islamabad
Islamabad Escorts | Call 03274100048 | Escort Service in IslamabadAyesha Khan
 
Call Us 📲8800102216📞 Call Girls In DLF City Gurgaon
Call Us 📲8800102216📞 Call Girls In DLF City GurgaonCall Us 📲8800102216📞 Call Girls In DLF City Gurgaon
Call Us 📲8800102216📞 Call Girls In DLF City Gurgaoncallgirls2057
 
Future Of Sample Report 2024 | Redacted Version
Future Of Sample Report 2024 | Redacted VersionFuture Of Sample Report 2024 | Redacted Version
Future Of Sample Report 2024 | Redacted VersionMintel Group
 
Case study on tata clothing brand zudio in detail
Case study on tata clothing brand zudio in detailCase study on tata clothing brand zudio in detail
Case study on tata clothing brand zudio in detailAriel592675
 
8447779800, Low rate Call girls in Shivaji Enclave Delhi NCR
8447779800, Low rate Call girls in Shivaji Enclave Delhi NCR8447779800, Low rate Call girls in Shivaji Enclave Delhi NCR
8447779800, Low rate Call girls in Shivaji Enclave Delhi NCRashishs7044
 
8447779800, Low rate Call girls in Uttam Nagar Delhi NCR
8447779800, Low rate Call girls in Uttam Nagar Delhi NCR8447779800, Low rate Call girls in Uttam Nagar Delhi NCR
8447779800, Low rate Call girls in Uttam Nagar Delhi NCRashishs7044
 
Organizational Structure Running A Successful Business
Organizational Structure Running A Successful BusinessOrganizational Structure Running A Successful Business
Organizational Structure Running A Successful BusinessSeta Wicaksana
 

Recently uploaded (20)

Keppel Ltd. 1Q 2024 Business Update Presentation Slides
Keppel Ltd. 1Q 2024 Business Update  Presentation SlidesKeppel Ltd. 1Q 2024 Business Update  Presentation Slides
Keppel Ltd. 1Q 2024 Business Update Presentation Slides
 
8447779800, Low rate Call girls in Saket Delhi NCR
8447779800, Low rate Call girls in Saket Delhi NCR8447779800, Low rate Call girls in Saket Delhi NCR
8447779800, Low rate Call girls in Saket Delhi NCR
 
Independent Call Girls Andheri Nightlaila 9967584737
Independent Call Girls Andheri Nightlaila 9967584737Independent Call Girls Andheri Nightlaila 9967584737
Independent Call Girls Andheri Nightlaila 9967584737
 
2024 Numerator Consumer Study of Cannabis Usage
2024 Numerator Consumer Study of Cannabis Usage2024 Numerator Consumer Study of Cannabis Usage
2024 Numerator Consumer Study of Cannabis Usage
 
Call Girls In Radisson Blu Hotel New Delhi Paschim Vihar ❤️8860477959 Escorts...
Call Girls In Radisson Blu Hotel New Delhi Paschim Vihar ❤️8860477959 Escorts...Call Girls In Radisson Blu Hotel New Delhi Paschim Vihar ❤️8860477959 Escorts...
Call Girls In Radisson Blu Hotel New Delhi Paschim Vihar ❤️8860477959 Escorts...
 
MAHA Global and IPR: Do Actions Speak Louder Than Words?
MAHA Global and IPR: Do Actions Speak Louder Than Words?MAHA Global and IPR: Do Actions Speak Louder Than Words?
MAHA Global and IPR: Do Actions Speak Louder Than Words?
 
8447779800, Low rate Call girls in Tughlakabad Delhi NCR
8447779800, Low rate Call girls in Tughlakabad Delhi NCR8447779800, Low rate Call girls in Tughlakabad Delhi NCR
8447779800, Low rate Call girls in Tughlakabad Delhi NCR
 
Corporate Profile 47Billion Information Technology
Corporate Profile 47Billion Information TechnologyCorporate Profile 47Billion Information Technology
Corporate Profile 47Billion Information Technology
 
Ten Organizational Design Models to align structure and operations to busines...
Ten Organizational Design Models to align structure and operations to busines...Ten Organizational Design Models to align structure and operations to busines...
Ten Organizational Design Models to align structure and operations to busines...
 
Call Girls in DELHI Cantt, ( Call Me )-8377877756-Female Escort- In Delhi / Ncr
Call Girls in DELHI Cantt, ( Call Me )-8377877756-Female Escort- In Delhi / NcrCall Girls in DELHI Cantt, ( Call Me )-8377877756-Female Escort- In Delhi / Ncr
Call Girls in DELHI Cantt, ( Call Me )-8377877756-Female Escort- In Delhi / Ncr
 
Kenya Coconut Production Presentation by Dr. Lalith Perera
Kenya Coconut Production Presentation by Dr. Lalith PereraKenya Coconut Production Presentation by Dr. Lalith Perera
Kenya Coconut Production Presentation by Dr. Lalith Perera
 
FULL ENJOY Call girls in Paharganj Delhi | 8377087607
FULL ENJOY Call girls in Paharganj Delhi | 8377087607FULL ENJOY Call girls in Paharganj Delhi | 8377087607
FULL ENJOY Call girls in Paharganj Delhi | 8377087607
 
Islamabad Escorts | Call 03274100048 | Escort Service in Islamabad
Islamabad Escorts | Call 03274100048 | Escort Service in IslamabadIslamabad Escorts | Call 03274100048 | Escort Service in Islamabad
Islamabad Escorts | Call 03274100048 | Escort Service in Islamabad
 
Japan IT Week 2024 Brochure by 47Billion (English)
Japan IT Week 2024 Brochure by 47Billion (English)Japan IT Week 2024 Brochure by 47Billion (English)
Japan IT Week 2024 Brochure by 47Billion (English)
 
Call Us 📲8800102216📞 Call Girls In DLF City Gurgaon
Call Us 📲8800102216📞 Call Girls In DLF City GurgaonCall Us 📲8800102216📞 Call Girls In DLF City Gurgaon
Call Us 📲8800102216📞 Call Girls In DLF City Gurgaon
 
Future Of Sample Report 2024 | Redacted Version
Future Of Sample Report 2024 | Redacted VersionFuture Of Sample Report 2024 | Redacted Version
Future Of Sample Report 2024 | Redacted Version
 
Case study on tata clothing brand zudio in detail
Case study on tata clothing brand zudio in detailCase study on tata clothing brand zudio in detail
Case study on tata clothing brand zudio in detail
 
8447779800, Low rate Call girls in Shivaji Enclave Delhi NCR
8447779800, Low rate Call girls in Shivaji Enclave Delhi NCR8447779800, Low rate Call girls in Shivaji Enclave Delhi NCR
8447779800, Low rate Call girls in Shivaji Enclave Delhi NCR
 
8447779800, Low rate Call girls in Uttam Nagar Delhi NCR
8447779800, Low rate Call girls in Uttam Nagar Delhi NCR8447779800, Low rate Call girls in Uttam Nagar Delhi NCR
8447779800, Low rate Call girls in Uttam Nagar Delhi NCR
 
Organizational Structure Running A Successful Business
Organizational Structure Running A Successful BusinessOrganizational Structure Running A Successful Business
Organizational Structure Running A Successful Business
 

2_Unit1_1-1.ppt

  • 2. Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 2 Outline  Welcome to Microprocessor and Assembly Language  High-Level, Assembly-, and Machine-Languages  Components of a Computer System  Chip Manufacturing Process  Technology Improvements  Programmer's View of a Computer System
  • 3. Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 3 Welcome to Microprocessor and Assembly Language  Instructor: Dr. Sellami Ali  Office:  Office Phone:  Office Hours:  Email:  sellami2003@hotmail.com
  • 4. Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 4 Which Textbooks will be Used?  Computer Organization & Design: The Hardware/Software Interface  Third Edition  David Patterson and John Hennessy  Morgan Kaufmann Publishers, 2005  MIPS Assembly Language Programming  Robert Britton  Pearson Prentice Hall, 2004  Supplement for Lab  Read the textbooks in addition to slides
  • 5. Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 5 Course Objectives  Towards the end of this course, you should be able to …  Describe the instruction set architecture of a MIPS processor  Analyze, write, and test MIPS assembly language programs  Describe organization/operation of integer & floating-point units  Design the datapath and control of a single-cycle CPU  Design the datapath/control of a pipelined CPU & handle hazards  Analyze the performance of processors and caches
  • 6. Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 6 Grading Policy  Assignments and Quizzes 10%  Exam I 15%  Exam II 15%  Laboratory 10%  Project 10%  Final 40%  Attendance will be taken regularly.  Excuses for officially authorized absences must be presented no later than two days following resumption of class attendance.  Late assignments will be accepted (upto 3 days) but you will be penalized 10% per each late day.  A student caught cheating in any of the assignments will get 0 out of 10%.  No makeup will be made for missing Quizzes or Exams.
  • 7. Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 7 Course Topics  Introduction Introduction to computer architecture, assembly and machine languages, components of a computer system, memory hierarchy, instruction execution cycle, chip manufacturing process, technology trends, programmer’s view of a computer system.  Review of Data Representation Binary and hexadecimal numbers, signed integers, binary and hexadecimal addition and subtraction, carry and overflow, characters and ASCII table.  Instruction Set Architecture Instruction set design, RISC design principles, MIPS instructions and formats, registers, arithmetic instructions, bit manipulation, load and store instructions, byte ordering, jump and conditional branch instructions, addressing modes, pseudo instructions.
  • 8. Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 8 Course Topics  MIPS Assembly Language Programming Assembly language tools, program template, directives, text, data, and stack segments, defining data, arrays, and strings, array indexing and traversal, translating expressions, if else statements, loops, indirect jump and jump table, console input and output.  Procedures and the Runtime Stack Runtime stack and its applications, defining a procedure, procedure calls and return address, nested procedure calls, passing arguments in registers and on the stack, stack frames, value and reference parameters, saving and restoring registers, local variables on the stack.  Interrupts Software exceptions, syscall instruction, hardware interrupts, interrupt processing and handler, MIPS coprocessor 0.
  • 9. Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 9 Course Topics  Integer Arithmetic and ALU design Hardware adders, barrel shifter, multifunction ALU design, integer multiplication, shift add multiplication hardware, Shift-subtract division algorithm and hardware, MIPS integer multiply and divide instructions, HI and LO registers.  Floating-point arithmetic Floating-point representation, IEEE 754 standard, FP addition and multiplication, rounding, MIPS floating-point coprocessor and instructions.  CPU Performance CPU performance and metrics, CPI and performance equation, MIPS, Amdahl’s law.
  • 10. Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 10 Course Topics  Single-Cycle Datapath and Control Design Designing a processor, register transfer, datapath components, register file design, clocking methodology, control signals, implementing the control unit, estimating longest delay.  Pipelined Datapath and Control Pipelining concepts, timing and performance, 5-stage MIPS pipeline, pipelined datapath and control, pipeline hazards, data hazards and forwarding, control hazards, branch prediction.
  • 11. Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 11 Software Tools  MIPS Simulators  MARS: MIPS Assembly and Runtime Simulator  Runs MIPS-32 assembly language programs  Website: http://courses.missouristate.edu/KenVollmar/MARS/  PCSPIM  Also Runs MIPS-32 assembly language programs  Website: http://www.cs.wisc.edu/~larus/spim.html  CPU Design and Simulation Tool  Logisim  Educational tool for designing and simulating CPUs  Website: http://ozark.hendrix.edu/~burch/logisim/
  • 12. Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 12 What is “Computer Architecture” ?  Computer Architecture = Instruction Set Architecture + Computer Organization  Instruction Set Architecture (ISA)  WHAT the computer does (logical view)  Computer Organization  HOW the ISA is implemented (physical view)  We will study both in this course
  • 13. Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 13 Next . . .  Welcome to Microprocessor and Assembly Language  High-Level, Assembly-, and Machine-Languages  Components of a Computer System  Chip Manufacturing Process  Technology Improvements  Programmer's View of a Computer System
  • 14. Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 14 Some Important Questions to Ask  What is Assembly Language?  What is Machine Language?  How is Assembly related to a high-level language?  Why Learn Assembly Language?  What is an Assembler, Linker, and Debugger?
  • 15. Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 15 A Hierarchy of Languages Application Programs High-Level Languages Assembly Language Machine Language Hardware High-Level Language Low-Level Language Machine independent Machine specific
  • 16. Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 16 Assembly and Machine Language  Machine language  Native to a processor: executed directly by hardware  Instructions consist of binary code: 1s and 0s  Assembly language  Slightly higher-level language  Readability of instructions is better than machine language  One-to-one correspondence with machine language instructions  Assemblers translate assembly to machine code  Compilers translate high-level programs to machine code  Either directly, or  Indirectly via an assembler
  • 17. Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 17 Compiler and Assembler
  • 18. Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 18 Instructions and Machine Language  Each command of a program is called an instruction (it instructs the computer what to do).  Computers only deal with binary data, hence the instructions must be in binary format (0s and 1s) .  The set of all instructions (in binary form) makes up the computer's machine language. This is also referred to as the instruction set.
  • 19. Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 19 Instruction Fields  Machine language instructions usually are made up of several fields. Each field specifies different information for the computer. The major two fields are:  Opcode field which stands for operation code and it specifies the particular operation that is to be performed.  Each operation has its unique opcode.  Operands fields which specify where to get the source and destination operands for the operation specified by the opcode.  The source/destination of operands can be a constant, the memory or one of the general-purpose registers.
  • 20. Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 20 MIPS Assembly Language: sll $2,$5, 2 add $2,$4,$2 lw $15,0($2) lw $16,4($2) sw $16,0($2) sw $15,4($2) jr $31 Compiler Translating Languages Program (C Language): swap(int v[], int k) { int temp; temp = v[k]; v[k] = v[k+1]; v[k+1] = temp; } A statement in a high-level language is translated typically into several machine-level instructions MIPS Machine Language: 00051080 00821020 8C620000 8CF20004 ACF20000 AC620004 03E00008 Assembler
  • 21. Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 21 Advantages of High-Level Languages  Program development is faster  High-level statements: fewer instructions to code  Program maintenance is easier  For the same above reasons  Programs are portable  Contain few machine-dependent details  Can be used with little or no modifications on different machines  Compiler translates to the target machine language  However, Assembly language programs are not portable
  • 22. Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 22 Why Learn Assembly Language?  Many reasons:  Accessibility to system hardware  Space and time efficiency  Writing a compiler for a high-level language  Accessibility to system hardware  Assembly Language is useful for implementing system software  Also useful for small embedded system applications  Space and Time efficiency  Understanding sources of program inefficiency  Tuning program performance  Writing compact code
  • 23. Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 23 Assembly Language Programming Tools  Editor  Allows you to create and edit assembly language source files  Assembler  Converts assembly language programs into object files  Object files contain the machine instructions  Linker  Combines object files created by the assembler with link libraries  Produces a single executable program  Debugger  Allows you to trace the execution of a program  Allows you to view machine instructions, memory, and registers
  • 24. Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 24 Assemble and Link Process Source File Source File Source File Assembler Object File Assembler Object File Assembler Object File Linker Executable File Link Libraries A project may consist of multiple source files Assembler translates each source file separately into an object file Linker links all object files together with link libraries
  • 25. Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 25 MARS Assembler and Simulator Tool
  • 26. Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 26 Next . . .  Welcome to Microprocessor and Assembly Language  High-Level, Assembly-, and Machine-Languages  Components of a Computer System  Chip Manufacturing Process  Technology Improvements  Programmer's View of a Computer System
  • 27. Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 27  Processor  Datapath  Control  Memory & Storage  Main Memory  Disk Storage  Input devices  Output devices  Bus: Interconnects processor to memory and I/O  Network: newly added component for communication Components of a Computer System Computer Memory I/O Devices Input Output B U S Control Datapath Processor Disk Network
  • 28. Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 28 Input Devices Logical arrangement of keys 0 1 2 3 c d e f 8 9 a b 4 5 6 7 Mechanical switch Spring Key Cap Contacts Membrane switch Conductor-coated membrane
  • 29. Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 29 Output Devices Laser printing Rollers Sheet of paper Light from optical system Toner Rotating drum Cleaning of excess toner Charging Heater Fusing of toner
  • 30. Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 30 Memory  Ordered sequence of bytes  The sequence number is called the memory address  Byte addressable memory  Each byte has a unique address  Supported by almost all processors  Physical address space  Determined by the address bus width  Pentium has a 32-bit address bus  Physical address space = 4GB = 232 bytes  Itanium with a 64-bit address bus can support  Up to 264 bytes of physical address space
  • 31. Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 31 Address Space Address Space is the set of memory locations (bytes) that can be addressed
  • 32. Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 32 Address, Data, and Control Bus  Address Bus  Memory address is put on address bus  If memory address = a bits then 2a locations are addressed  Data Bus: bi-directional bus  Data can be transferred in both directions on the data bus  Control Bus  Signals control transfer of data  Read request  Write request  Done transfer Memory 0 1 2 3 2a – 1 . . . read write done data bus address bus Processor d bits a bits Address Register Data Register Bus Control
  • 33. Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 33 Memory Devices  Volatile Memory Devices  Data is lost when device is powered off  RAM = Random Access Memory  DRAM = Dynamic RAM  1-Transistor cell + trench capacitor  Dense but slow, must be refreshed  Typical choice for main memory  SRAM: Static RAM  6-Transistor cell, faster but less dense than DRAM  Typical choice for cache memory  Non-Volatile Memory Devices  Stores information permanently  ROM = Read Only Memory  Used to store the information required to startup the computer  Many types: ROM, EPROM, EEPROM, and FLASH  FLASH memory can be erased electrically in blocks
  • 34. Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 34 Arm provides read/write heads for all surfaces The disk heads are connected together and move in conjunction Track 0 Track 1 Recording area Spindle Direction of rotation Platter Read/write head Actuator Arm Track 2 A Magnetic disk consists of a collection of platters Provides a number of recording surfaces Magnetic Disk Storage
  • 35. Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 35 Magnetic Disk Storage Track 0 Track 1 Sector Recording area Spindle Direction of rotation Platter Read/write head Actuator Arm Track 2 Disk Access Time = Seek Time + Rotation Latency + Transfer Time Seek Time: head movement to the desired track (milliseconds) Rotation Latency: disk rotation until desired sector arrives under the head Transfer Time: to transfer data
  • 36. Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 36 Processor-Memory Performance Gap  1980 – No cache in microprocessor  1995 – Two-level cache on microprocessor CPU: 55% per year DRAM: 7% per year 1 10 100 1000 1980 1981 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 1982 Processor-Memory Performance Gap: (grows 50% per year) Performance “Moore’s Law”
  • 37. Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 37 The Need for a Memory Hierarchy  Widening speed gap between CPU and main memory  Processor operation takes less than 1 ns  Main memory requires more than 50 ns to access  Each instruction involves at least one memory access  One memory access to fetch the instruction  A second memory access for load and store instructions  Memory bandwidth limits the instruction execution rate  Cache memory can help bridge the CPU-memory gap  Cache memory is small in size but fast
  • 38. Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 38 Typical Memory Hierarchy  Registers are at the top of the hierarchy  Typical size < 1 KB  Access time < 0.5 ns  Level 1 Cache (8 – 64 KB)  Access time: 0.5 – 1 ns  L2 Cache (512KB – 8MB)  Access time: 2 – 10 ns  Main Memory (1 – 2 GB)  Access time: 50 – 70 ns  Disk Storage (> 200 GB)  Access time: milliseconds Microprocessor Registers L1 Cache L2 Cache Memory Disk, Tape, etc Memory Bus I/O Bus Faster Bigger
  • 39. Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 39 Processor  Datapath: part of a processor that executes instructions  Control: generates control signals for each instruction A L U Registers Instruction Program Counter Instruction Cache Next Program Counter Data Cache Control
  • 40. Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 40 Datapath Components  Program Counter (PC)  Contains address of instruction to be fetched  Next Program Counter: computes address of next instruction  Instruction Register (IR)  Stores the fetched instruction  Instruction and Data Caches  Small and fast memory containing most recent instructions/data  Register File  General-purpose registers used for intermediate computations  ALU = Arithmetic and Logic Unit  Executes arithmetic and logic instructions  Buses  Used to wire and interconnect the various components
  • 41. Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 41 Fetch instruction Compute address of next instruction Generate control signals for instruction Read operands from registers Compute result value Writeback result in a register Fetch - Execute Cycle Instruction Decode Instruction Fetch Execute Writeback Result Infinite Cycle implemented in Hardware Memory Access Read or write memory (load/store)
  • 42. Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 42 Next . . .  Welcome to Microprocessor and Assembly Language  Assembly-, Machine-, and High-Level Languages  Components of a Computer System  Chip Manufacturing Process  Technology Improvements  Programmer's View of a Computer System
  • 43. Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 43 Chip Manufacturing Process Silicon ingot Slicer Blank wafers 20 to 30 processing steps 8-12 in diameter 12-24 in long < 0.1 in thick Patterned wafer Dicer Individual dies Die Tester Tested dies Bond die to package Packaged dies Part Tester Tested Packaged dies Ship to Customers
  • 44. Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 44 Wafer of Pentium 4 Processors  8 inches (20 cm) in diameter  Die area is 250 mm2  About 16 mm per side  55 million transistors per die  0.18 μm technology  Size of smallest transistor  Improved technology uses  0.13 μm and 0.09 μm  Dies per wafer = 169  When yield = 100%  Number is reduced after testing  Rounded dies at boundary are useless
  • 45. Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 45 Inside the Pentium 4 Processor Chip
  • 46. Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 46 Next . . .  Welcome to Microprocessor and Assembly Language  Assembly-, Machine-, and High-Level Languages  Components of a Computer System  Chip Manufacturing Process  Technology Improvements  Programmer's View of a Computer System
  • 47. Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 47 Technology Improvements  Vacuum tube → transistor → IC → VLSI  Processor  Transistor count: about 30% to 40% per year  Memory  DRAM capacity: about 60% per year (4x every 3 yrs)  Cost per bit: decreases about 25% per year  Disk  Capacity: about 60% per year  Opportunities for new applications  Better organizations and designs
  • 48. Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 48 Growth of Capacity per DRAM Chip  DRAM capacity quadrupled almost every 3 years  60% increase per year, for 20 years
  • 49. Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 49 Workstation Performance More than 1000 times improvement between 1987 and 2003 Improvement is between 50% and 60% per year
  • 50. Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 50 Microprocessor Sales (1998 – 2002)  ARM processor sales exceeded Intel IA-32 processors, which came second  ARM processors are used mostly in cellular phones  Most processors today are embedded in cell phones, video games, digital TVs, PDAs, and a variety of consumer devices
  • 51. Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 51 Microprocessor Sales – cont'd
  • 52. Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 52 Next . . .  Welcome to Microprocessor and Assembly Language  Assembly-, Machine-, and High-Level Languages  Components of a Computer System  Chip Manufacturing Process  Technology Improvements  Programmer's View of a Computer System
  • 53. Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 53 Programmer’s View of a Computer System Application Programs High-Level Language Assembly Language Operating System Instruction Set Architecture Microarchitecture Physical Design Level 0 Level 1 Level 2 Level 3 Level 4 Level 5 Increased level of abstraction Each level hides the details of the level below it Software Hardware Interface SW & HW
  • 54. Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 54 Programmer's View – 2  Application Programs (Level 5)  Written in high-level programming languages  Such as Java, C++, Pascal, Visual Basic . . .  Programs compile into assembly language level (Level 4)  Assembly Language (Level 4)  Instruction mnemonics are used  Have one-to-one correspondence to machine language  Calls functions written at the operating system level (Level 3)  Programs are translated into machine language (Level 2)  Operating System (Level 3)  Provides services to level 4 and 5 programs  Translated to run at the machine instruction level (Level 2)
  • 55. Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 55 Programmer's View – 3  Instruction Set Architecture (Level 2)  Interface between software and hardware  Specifies how a processor functions  Machine instructions, registers, and memory are exposed  Machine language is executed by Level 1 (microarchitecture)  Microarchitecture (Level 1)  Controls the execution of machine instructions (Level 2)  Implemented by digital logic  Physical Design (Level 0)  Implements the microarchitecture  Physical layout of circuits on a chip
  • 56. Introduction ICS 233 – Computer Architecture and Assembly Language – KFUPM © Muhamed Mudawar slide 56 Course Roadmap  Instruction set architecture (Chapter 2)  MIPS Assembly Language Programming (Chapter 2)  Computer arithmetic (Chapter 3)  Performance issues (Chapter 4)  Constructing a processor (Chapter 5)  Pipelining to improve performance (Chapter 6)  Memory and caches (Chapter 7) Key to obtain a good grade: read the textbook!