Lec 6
Lec 6
Microcomputer Architecture
This lecture gives an overview of the architecture of a simple microcomputer. It describes the operation of the CPU
address and data buses during read and write cycles.
After this lecture you should be able to: (1) show how the following buses and signals are connected in a micro-
computer system: power and ground, address and data buses, read and write strobes, and chip enables; (2) give the
sequence of signals that must appear on the address, data, and control lines of a memory or I/O chip in order to read
or write a particular data value to/from a particular address; (3) explain the purpose of these lines; and (4) compute
the number of address lines required for a given memory size or vice-versa.
Microcomputer Components EPROMs (erasable programmable read-only mem-
ory) which can be erased by exposing them to strong
A microcomputer is usually assembled from a micro- ultra-violet light for several minutes and then re-
processor chip (CPU1) connected to memory chips written using a device programmer. EEPROMs
and I/O (input/output) chips.
(electrically erasable programmable read-only mem-
CPU Memory I/O
ory) are similar to EPROMs, but individual addresses
can be erased (by writing to “magic” addresses) and
then re-written. “Flash” EEPROMs are similar, but
Address Bus
Data Bus
vice) to generate a given value on its data output for R/W* (write strobe)
each address input.
Address ROM
lec6.tex 1
addressed memory location the case of the data bus, if it can alternate between
There are two main types of RAM chips. Static the two directions.
RAM (SRAM) chip storage their state in flip-flops
data bus
memory and I/O chips. Multiple memory devices
clock
2
Read and Write Cycles the RAM detects the high signal on the WR line
and turns its data bus into an input
The following diagram shows the signals on a ROM
or RAM during a read cycle. the RAM stores the value currently on the data
1 next cycle
bus into the desired memory location inside the
Address Bus
RAM
4 5
Data Bus
Read Strobe 3 6 Exercise: Draw a timing diagram and write out a table similar
to those above showing the values appearing on the two strobes
The following operations take place during a read
and the address and data buses when the value 0x33 is written
operation (“cycle”):
to address 0x1200.
the CPU asserts (brings high) the RD signal line I/O chips are used to allow the CPU to interface with
(3) peripherals (keyboards, printers, etc).
An output I/O chip consists of D flip-flops which
the RAM detects the high signal on the RD line are loaded during a write cycle. The flip-flops’ in-
and turns its data bus into an output (4) puts (D) are connected to the data bus and the outputs
the RAM looks up the value current value stored (Q) are connected to the peripheral. When the CPU
for that memory location and, after a short delay writes to the memory location that clocks the flip-
(the access time), outputs it on the data bus (5) flops, the flip-flops are loaded and the values written
to them remain on the output pins.
the CPU read the value from the memory (6) An input chip is simply buffer that causes the value
currently on the input pins to be transferred to the
The following table shows the values of the differ- CPU. This allows the CPU to monitor the state of the
ent signals over time during a read cycle where the input pins on the I/O chip.
CPU reads the value 0x32 from address 0x105:
The following diagram shows the internal struc-
address data RD WR ture of a simple parallel i/o chip:
bus bus Data Bus
D Q
0x105 X 0 0
0x105 X 1 0
decoder
Address Bus
0x105 0x32 1 0
Write Strobe
Data Bus
cycle:
decoder
Address Bus
the CPU puts the address of the desired memory Read Strobe
location on the address bus
There are many different I/O chips available. They
the CPU turns its data bus into an output usually include additional logic circuits to make it
easier for the CPU to deal with specific peripherals
the CPU puts the value to be stored on the data
such as modems or hard disks. Later in the course
bus
we will look at a few common interface chips.
the CPU asserts (brings high) the WR signal The following diagram shows the external inter-
line face of an i/o chip:
3
power CPU, 64 bytes of RAM, 1kB of flash EEPROM for
ground
input pins
peripheral
program storage and 12 pins which can be used for
address bus I/O
I/O. Current microcontrollers range from 8-pin de-
output pins vices that sell for less than $1 to chips with hundreds
enable peripheral
RD (read strobe)
of pins that include Intel 486 processor ‘cores.’
WR (write strobe)
Address Decoders
A microcomputer often uses several memory and I/O
chips, each of which is smaller than the total amount
of memory that the microprocessor (CPU) can ad-
dress. For example, a CPU with with a 16-bit address
bus can address a 64 kBytes of memory but may be
used in a system with a 16 kByte RAM chip, a 32
kByte EPROM chip and a 4-byte I/O chip.
Exercise: How many address lines are required by each of
the above chips?
The purpose of the address decoder is to look at
the address output by the CPU and enable individual
memory or I/O chips. The following diagram shows
the inputs and outputs of an address decoder:
enable
power
Address enable
ground
Decoder
address bus enable
Microcontrollers
A microcontroller is a single-chip microcomputer.
The single chip includes the CPU, a RAM, an I/O
chip and an EPROM or EEPROM. This allows all of
the pins on the chip to be used for I/O. For example
the Atmel 89C1051 is a typical microcontroller. It is
a 20-pin chip which contains a clone of an Intel 8051