Title: Figure 7'14 A simple 32bit instruction format
1Figure 7.14 A simple 32-bit instruction format
A Simple 32-bit Instruction Format
2Classification of Instructions
- Data movement instructions (LOAD, STORE, and
others) - Most frequently used, include instruction to move
data from memory to general registers, from
general registers to memory, between different
general registers - Arithmetic instructions
- There may be several different integer arithmetic
instruction formats providing various
combinations of register and memory access in
different addressing modes
3- Boolean logic instructions
- Example NOT, AND , OR instructions
- Single operand manipulation instructions
- Most of them operate on the value in the
register, but some of them operate on memory
values as well - Example increment a value, decrement a value or
resetting a value. - Bit manipulation instructions
- Provide setting and resetting of individual bits
in a data word.
4Figure 7.17 Typical register shifts and rotates
Shift and Rotate Instructions
Page 192
5- Shift and rotate instructions
- Logical shift simply shift the data
- Arithmetic shift used to multiply or divide the
original value by a power of 2. The leftmost bit
is not shift. - Program control instructions control the flow
of a program, include jumps, branches and
subroutine CALL and RETURN instructions.
6Figure 7.18 Operation of CALL and RETURN
instructions
7Stack instructions
- Stack instructions
- Stack data storage used to store data when the
most recently used data will be the first needed.
LIFO last-in, first-out structures. - Stacks are an efficient way of storing
intermediate data values during complex
calculations. Example PUSH and POP instructions - others
8Figure 7.19 Using a stack
Using a Stack
9Figure 7.22 Using a block of memory as a stack
10Buses
11Buses
- Definition a collection of electrical conductors
(eg wires, traces) with a common purpose - The physical connection that makes it possible to
transfer data from one location in the computer
system to another. - Each wire or trace is called a line
- Typically, buses carry information from one place
to another
From our first lecture
Ed k c
12bus
Ports
Printer Mouse Keyboard Modem
Diskcontroller
Graphicscard
Monitor Speakers
CPU
Soundcard
RAM
Networkcard
Computer
13Lines
- Each line carries a single electrical signal.
- The signal can represent one bit of a memory
address, or sequence of data bits, or a timing
control that turns a device on and off at the
proper time. - General categories
- data
- addressing
- control and power.
14Types of Buses (1 of 3)
- Point-to-point. The bus carries signals from a
specific source to a specific destination.
Serial port
Modem
Control unit
ALU
15Types of Buses (2 of 3)
- Multipoint used to connect several points together
Computer
Computer
Computer
Computer
CPU
Memory
Disk controller
Video controller
16Types of Buses (3 of 3)
Device controller
Device
Device
Device
Terminator
17Figure 7.8 Point-to-point and multipoint buses
18Buses Inside a Computer
CPU
Data bus Address bus Control bus
Memory
I/O Module
I/O Device
19Data Bus
- Carries data between the CPU and memory or I/O
devices - Bi-directional
- Data transferred out of the CPU for write
operations - Data transferred into the CPU for read
operations - Typical sizes 8, 16, 32, 64 lines
- Signal names
- D0, D1, D2, D3, etc.
20Address Bus
- Carries an address from the CPU to Memory or I/O
devices - Unidirectional
- The address is always supplied by the CPU
- Typical sizes 16, 20, 24 lines
- Signal names
- A0, A1, A2, A3, etc.
21Control Bus
- Collection of signals for coordinating CPU
activities - Each signal has a unique purpose
- Typical sizes 10-20 lines
- Signals are output, input, or bi-directional
- Typical signals
- /RD (read)
- /WR (write
- CLK (clock)
- /IRQ (interrupt request)
- etc.
22Input / OutputChapter 8Sections 8.0-8.4
23Introduction
- I/O predominant factor in computers
- LMC I/O baskets correspond to a set of busses and
registers in a hardware I/O module - Programmed I/O (data is transferred one word at a
time) - Complicating factors
- Many I/O devices. Need
- Device identification
- Synchronization of operations
- I/O operations take a lot of computer time. Need
to run them in parallel with CPU activity gt
Operating System
24Background
- Operating System
- Manage I/O devices and data transfer operations
- Manage multiple programs
25Characteristics of Typical I/O Devices
- Characteristics of I/O devices affect computer
performance - Example 1 Keyboard
- Slow data is transferred one word at a time
- Two types of input expected and unexpected
(unpredicted) ltCtrl-Cgt, ltCtrl-Alt-Delgt - Possibly many keyboards
- Example 2 disks
- Data can be transferred in blocks fast
- Possible many disks
- Example 3 network interfaces
26Characteristics of Typical I/O Devices
- I/O operations are typically initiated by
programs, but sometimes I/O devices need to
initiate them too - Devices are connected to the CPU via hardware I/O
modules (device controllers) - Requirements for efficient I/O. Must have
- Individual addressing of I/O devices
- Method for devices to initiate communication with
the CPU - Programmed I/O for slow devices non-programmed
I/O for fast devices - Means to handle uniformly very different devices
27Differences in I/O devices
- Data format
- One piece of data to blocks of data
- Parallel and sequential transmission
- Speed and synchronization
- Data flow
- Electromechanical requirements must be met
28Examples of I/O Devices
- Device Input/Output Date Rate (Kbytes/s)
- Keyboard Input 0.01
- Mouse Input 0.02
- Voice input (microphone) Input 0.02
- Scanner Input 200
- Voice output (speaker) Output 0.5
- Dot-matrix printer Output 1
- Laser printer Output 100
- Graphics display Output 30,000
- Local area network Input/output 200 20,000
- Optical disk Storage (I/O) 500
- Magnetic tape Storage (I/O) 2,000
- Magnetic disk Storage (I/O) 2,000
See Text Figure 8.1 - page 207
29Programmed I/O
- I/O operations are under direct control of
software (program) - Software initiates the I/O operation
- Disadvantage
- Slow (data is transferred one word at a time)
- Uses a lot of CPU resources
- Advantage
- Simple
30Simple I/O Configuration
31More Complex I/O Module Arrangement
Multiple devices
32I/O Configurations (1 of 2)
CPU
Keyboard Mouse Voice input (microphone) Scanner V
oice output (speaker) Dot-matrix printer Laser
printer Graphics display Local area network
Optical disk Magnetic tape Magnetic disk
- Can take many forms, e.g.,
- Sound card controller
- Disk controller
I/O module
I/O device
33I/O Configurations (2 of 2)
CPU
I/O data
I/O address
I/O control
I/O module
I/O module
I/O device
I/O device
I/O device
34Programmed I/O (1/2)
35Programmed I/O (2/2)
36Thank you