Professional Documents
Culture Documents
CSSE-402
Chapter 3
1
A Simple Microcomputer
Data Bus
INPUT
DEVICE Control
Bus
Bus MEMORY
I/O CENTRAL
(RAM AND
PORTS PROCESSING
UNIT (CPU) ROM)
OUTPUT
DEVICE
Address Bus
4
CPU
❚A typical CPU consists of
❙arithmetic-logic unit (ALU) which executes the instructions.
❙logic control unit which interprets and sequences
instructions and generates the bus control signals.
❙special purpose registers such as program counter (PC)
that holds the address of the next instruction or data item
to be fetched from memory.
❙general purpose registers which are used for temporary
storage of binary data- such as accumulator A, status
register, etc.
5
Memor
y
❚Two purposes :
(1)to store the binary codes for the sequences of
instructions that you want the computer to execute
(2)to store the binary-coded data with which the
computer is going to work with.
❚Types:
Usually it consists of a mixture of RAM, ROM and
sometimes bulk storage devices such as floppy disks,
magnetic hard disks or optical disks.
6
Input/Output
❚ Allows the computer to take data from or to the outside world,
through the interface. Peripherals such as keyboards, video
display terminals, printers, and modems are connected to the I/O
sections.
❚ The actual physical devices used to interface the computer buses
to external systems are often called ports.
❚ The simplest type of I/O port is a set of D flip-flops.
❙ If they are being used as an input port, the D inputs are connected to
the external device, and the Q outputs are connected to the data
bus.
❙ Data will then be transferred through the latches when they
are enabled by a control signal from the CPU.
❙ The same concept applies when using the D flip-flop for output.
7
Buses
❚Address bus
❙Unidirectional parallel signal lines connecting CPU and the
memory
❙Bus width; number of lines (wires), can be 16, 20, 24, 32,
or 64 parallel signal lines.
❙On these lines the CPU sends out the address of the
memory location that is to be written to or read from.
❙A CPU with n address lines can address 2n memory
locations. For example, a CPU with 16 address lines can
address 216 or 65,536 (64K) memory locations.
8
Buses
❚Data bus
❙bus width: 4, 8, 16, 32 or 64 bits
❙Bidirectional parallel signal lines (wires)
❙many devices can be connected to the data bus; but only
one at a time can have its output enabled.
❙Any device that is connected to the data bus must have
three-state outputs, so it can be disabled if not being used.
9
Buses
❚Control bus
❙consists of 4 to 10 parallel signal lines.
❙CPU sends out signal on the control bus to enable the
outputs of addressed memory or port devices
❙typical control bus signals: memory read, memory write,
I/O read and I/O write.
1
0
Buses
❚To read a byte of data from memory location, for
example, consists the following activities:
❙CPU sends out the memory address of the desired byte
on the address bus.
❙CPU sends out a Memory Read signal on the control bus.
❙The Memory Read signal enables the addressed memory
device to output a data word onto the data bus.
❙The data word from the memory travels along the data bus
to the CPU.
1
1
Hardware, Software, and
Firmware
❚Hardware is the physical devices and circuitry of the
computers.
❚Software is referred to the program written for the
computer.
❚Firmware is the term given to programs stored in
ROMs or in other devices which permanently keep
their stored information.
1
2
Instruction Cycle
Two steps:
Fetch
Execute
Fetch Cycle
Processor-memory
data transfer between CPU and main memory
Processor I/O
Data transfer between CPU and I/O module
Data processing
Some arithmetic or logical operation on data
Control
Alteration of sequence of operations
e.g. jump
Combination of above
Example of Program Execution
Instruction Cycle State Diagram
Interrupts
Disable interrupts
Processor will ignore further interrupts whilst processing one
interrupt
Interrupts remain pending and are checked after first interrupt has
been processed
Interrupts handled in sequence as they occur
Define priorities
Low priority interrupts can be interrupted by higher priority
interrupts
When higher priority interrupt has been processed, processor
returns to previous interrupt
Multiple Interrupts - Sequential
Multiple Interrupts – Nested
Time Sequence of
Multiple Interrupts
Connecting
Carries data
Remember that there is no difference between
“data” and “instruction” at this level
Width is a key determinant of performance
8, 16, 32, 64 bit
Address bus
Dedicated
Separate data & address lines
Multiplexed
Shared lines
Address valid or data valid control line
Advantage - fewer lines
Disadvantages
More complex control
Ultimate performance
Bus Arbitration
Centralised
Single hardware device controlling bus access
Bus Controller
Arbiter
May be part of CPU or separate
Distributed
Each module may claim the bus
Control logic on all modules
Timing
Systems lines
Including clock and reset
Address & Data
32 time mux lines for address/data
Interrupt & validate lines
Interface Control
Arbitration
Not shared
Direct connection to PCI bus arbiter
Error lines
PCI Bus Lines (Optional)
Interrupt lines
Not shared
Cache support
64-bit Bus Extension
Additional 32 lines
Time multiplexed
2 lines to enable devices to agree to use 64-bit transfer
JTAG/Boundary Scan
For testing procedures
PCI Commands
CONTROL BUS
SEQUENCE
ADDRESS BUS
DATA BUS
DATA BUS
5
6
A Typical PC Motherboard
Disk Controller
Video Card
Expansion
Slots
System
bus
640KB System Timer Keyboard
Dynamic ROM logic logic
RAM (8253) (8255)
Speaker Keyboard
5
7