Professional Documents
Culture Documents
Computer I/O
Keyboards
Displays
Printers
Magnetic Drives
Compact disk read only memory (CD-ROM)
Others
Modems or other communications devices
Scanners
Sound cards with speakers and microphones
Sample Peripherals
Devices
Keyboard
Scan matrix lies beneath the keys.
Whether a key is depressed and released, the control
code at the time of the event is sensed and is translated
12-1
by the microcontroller into K-scan code.
When a key is depressed, a make code is produced,
when a key is released a break code is produced.
er
cod
De
Microcontroller
Multiplexer
Hard Drive
The hard drive is the primary intermediate-speed,
nonvolatile, writable storage medium.
Revolutions Per Minute (rpm) : rotational speed of a disk
12-2
Disk access time and transfer time
Track
Sector
Head positioning
I/O Processors
I/O Processors handles all of the interactions between the
I/O devices and the CPU.
I/O Processors communicates with input and output
devices through separate address, data, and control lines.
of the CPU
CPU Instructions
Sends Command to test
IOP path
Status approved and
sends I/O commands
CPU continues with other
process
Request IOP status
Check status for correct
transfer.
IOP Operations
Transfer status to Memory
location
Access memory for IOP
Commands
Conduct I/O transfer
I/O transfer completed,
send status to CPU
Transfer status to memory
location
I/O Interfaces
The
Data bus
Central
processing
unit
(CPU)
Address bus
Control
Interface
Interface
Interface
Interface
Keyboard
CRT
display
Printer
Magnetic
disk
Input
device
Output
device
Output
device
I/O Configurations
The
I/O configurations
12-6
data bus
Chip select
Chip select
Register select
Register select
I/O read
I/O read
I/O write
I/O write
Bus
buffers
Bus
buffers
CS
CS
RS1
Timing
and
Timing
control
RS0
RD and
control
RD
WR
RS1
RS0
WR
I/O data
I/O data
Port B
register
Port B
register
Control
register
Control
register
I/O data
Control lines
Control lines
Status
register
Status
register
RS1
RS0
Register selected
Status lines
To I/O device
X RS0
X
None: data
bus in selected
high-impedance state
CS0 RS1
Register
0
0
1
Port A register
01
X0
X1 None:
data
bus in high-impedance state
Port B
register
01
0 0 Port
11
A register
Control
register
11
01
1 1 Port
B
register
Status register
2008 Pearson Education, Inc.
1
0
1
Control
register
M. Morris Mano & Charles R. Kime
1 FUNDAMENTALS,4e
1
1
Status register
AND COMPUTER
DESIGN
LOGIC
2008 Pearson
Education, Inc.
M. Morris Mano & Charles R. Kime
Status lines
To I/O device
To CPU
To CPU
CS
I/O data
Port A
register
Port A
register
Internal bus
Internal bus
12-6
Strobing
The data bus between the two units is assumed to be
12-7
made bidirectional by the use of three state buffers.
12-7
Destination unit
Destination unit
Data bus
Data bus
Strobe
Strobe
Source unit
Source unit
Data bus
Data bus
Strobe
Strobe
Source unit
Source unit
Destination unit
Destination unit
Data bus
Data bus
Strobe
Strobe
2008 Pearson Education, Inc.
M.
MorrisPearson
Mano &Education,
Charles R.Inc.
Kime
(b) Source-initiated
2008
LOGIC
AND
COMPUTER
DESIGN
M. Morris Mano & Charles R. Kime FUNDAMENTALS, 4e
Handshaking
12-8
Databus
Request
Destination unit
Reply
Source unit
Data bus
Request
Reply
(a) Destination-initiated transfer
Data bus
Request
Source unit
Reply
Data bus
Request
Reply
(b) Source-initiated transfer
Destination unit
Serial Communication
Serial Communication
uSerial
Serial Communication
Serial
Asynchronous Serial
Communication
Interacts with devices
outside of the computer
uEx:
modem connecting to
another computer
Synchronous Serial
transmission
Transmits block of data in
frames.
uFrames
Synchronous Transmission
Instead of transmitting a start and stop bit for each data
value, Synchronous transmission strings together several
data values into a data block called a frame.
There are several layers in the frame, similar to a data
packet.
There is a leading information, address of where the data
is going, control ensure correct destination, the data it
self, Cyclic redundancy check (CRC) to check there is no
error and the trailing information
transmission is occurring
uWhen to read a bit of data
uWhen
Steps:
Device 1 transmission will output a start bit
uA
Modes of Transfer
Data
DMA
DMA Transfer
12-20
Interrupt
BG
CPU
Memory
BR
RD
WR Address Data
RD
WR Address Data
Read control
Write control
Address bus
Data bus
Address
decoder
RD
WR Address Data
DS
RS
BR
DMA
controller
BG
Interrupt
DMA request
DMA acknowledge
I/O
peripheral
device
13-1
CPU
Cache
Main
memory
Hard
drive
13-2
cache
CPU
Data
cache
Main
memory
Hard
disk
all memory were only main memory (DRAM), 4 GB would cost $24,000 at
$6/MB
u access
time would be only 50 ns, rather than the 2-3 ns obtainable with onboard cache
we find instructions and data in the caches (hit) 95% of the time
System cost:
u SRAM
u DRAM
u 4
uTotal
By all appearances, a very large, very fast, and cheap memory system!
temporal locality
programs tend to contain loops (often nested loops) where an instruction and/or data
are accessed many times in sequence
spatial locality
instructions and/or data that are stored in contiguous (neighboring) locations are
often repeatedly accessed for reading or writing in a typical program
memory = the appearance that all 4GB addressable memory resides in main memory
Line: A block of data transferred into cache at a given time (4B in text illustrations)
the memory address is comprised of 5 bit tag, 3 bit index, and 2 bit byte fields
the cache stores both the data (line) as well as the main memory address (tag) of the
data
If the address of requested data does not match tag plus index address of data present
in cache, the cache signals the CPU that a cache miss has occurred.
u Main
memory transfers a new line (containing the requested data word) into the cache and also
sends the requested word (or byte) along to the CPU
When a cache miss occurs and a new line of data is to be transferred in from main
memory, the cache is likely already full of existing data lines so that one of them needs
to be replaced with the new data line. If the line to be replaced has been changed
since it was brought in from main memory, it must be written back into main memory
first.
Address
9
Tag
Index
Index
Byte
0000000000
0000000100
0000001000
Tag
0000001100
Data
000
0000010000
001
0000010100
010
0000011000
011
00000
Data
0000011100
100
101
110
111
Cache
1111100000
1111100100
1111110000
1111110100
1111101000
1111101100
1111111000
1111111100
Direct-mapped cache
Main memory
(b) Cache mapping
each program sees a memory space equal to the virtual address space
u the
hardware must map each virtual address into a physical address in main
memory
Virtual address space from different programs may map to the same
physical address space
u Allows