Decoding
Kuliah Pertemuan VI
Sistem Berbasis
Mikroprosesor
Lie Jasa
1
Methods of address decoding
• Control signals MEMR and MEMW are connected to the
RD and WR pins of the memory chip, respectively.
• In the case of the address buses, while the lower bits of
the address go directly to the memory chip address pins,
the upper ones are used to activate the CS pin of the
memory chip.
• It is the CS pin that along with RD/WR allows the flow of
data in or out of the memory chip.
• In other words, no data can be written into or read from
the memory chip unless CS is activated.
• The CS input is normally active low and can be activated
using one of the following methods of address decoding.
2
Simple logic gate as address decoder
3
Example
Example
• Looking at the design in prev. Figure, calculate the address range
for
• Y4,
• Solution:
• The address range for Y4 is calculated as follows.
• A19 A18 A17 A16 A15 A14 A13 A12 All A10 A9 A8 A7 A6 A5 A4 A3 A2 Al AO
• 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
• 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1
• The above shows that the range for Y4 is F0000H to F3FFFH.
• In prev. Figure notice that A19, A18, and A17 must be 1 for the
decoder to be activated.
• Y4 will be selected when A16A15A14=100(4in binary). The
remaining A13 - AO will be 0 for the lowest address and 1 for
the highest address
4
Using PAL16L8 as an address decoder
5
Conventional memory: 640K of RAM
6
• then more memory can be added through the expansion
slot.
• Of the 640K bytes of memory, some is used by the MS
DOS operating system (the amount depends on the
version of DOS)
• and the rest of the available RAM is used by utilities and
application programs. Some utilities are resident and
therefore take the memory away from applications.
• This 640K bytes of memory is commonly referred to as
conventional memory.
• Of the total amount of RAM installed (anywhere between
64K and 640K bytes),
• the first 1K (00000 to 003FF =1024 bytes) is set aside for
the interrupt vector table.
• From 00400 to 004FF is set aside for the BIOS
temporary data area.
• From 00500 to 005FF is set aside for DOS and the
BASIC language for temporary storage
7
• Partial Listing of IBM PC RAM Memory Map for Interrupt, BIOS Data
• Memory Location Bytes Description
• 0000:0000 to 0000:03FF 1024 interrupt table
• 0000:0400 to 0000:0401 2 port address of com1
• 0000:0402 to 0000:0403 2 port address of com2
• 0000:0404 to 0000:0405 2 port address of com3
• 0000:0406 to 0000:0407 2 port address of com4
• 0000:0408 to 0000:0409 2 port address of Lpt1
• 0000:040A to 0000:040B 2 port address of Lpt2
• 0000:040C to 0000:040D 2 port address of Lpt3
• 0000:040E to 0000:040F 2 port address of Lpt4
• 0000:0410 to 0000:0411 2 list of installed hardware
• 0000:0412 to 0000:0412 1 initialization flag
• 0000:0413 to 0000:0414 2 memory size (K bytes)
• 0000:0415 to 0000:0416 2 memory in I/O channel (if
any)
• 0000:0417 to 0000:0418 2 keyboard status flag
• 0000:0419 to 0000:0419 1 alternate key entry
storage
• 0000:041A to 0000:041B 2 keyboard buffer pointer
(head)
• 0000:041C to 0000:041D 2 keyboard buffer pointer
(tail)
8
• 0000:041E to 0000:043D 32 keyboard buffer
• 0000:043E to 0000:0448 11 diskette data area
• 0000:0449 to 0000:0449 1 current video mode
• 0000:044A to 0000:044B 2 number of columns on
screen
• 0000:044C to 0000:044D 2 regen buffer length
(bytes)
• 0000:044E to 0000:044F 2 regen buffer starting
offset
• 0000:0450 to 0000:045F 16 cursor position, pages 1-
8
• 0000:0460 to 0000:0460 1 cursor end line
• 0000:0461 to 0000:0461 1 cursor start line
• 0000:0462 to 0000:0462 1 currently displayed page
number
• 0000:0463 to 0000:0464 2 active display base
address
• 0000:0465 to 0000:0465 1 CRT mode register for
MDA or CGA
• 0000:0466 to 0000:0466 1 register for CGA
• 0000:0467 to 0000:046B 5 cassette data area
• 0000:046C to 0000:0470 5 timer data area
Example
• Show the calculation which verifies that addresses
00000 to 9FFFFH comprise 640K bytes.
• Solution:
• To calculate the total number of bytes for a given
memory address range, subtract the two addresses and
add 1 to get the total bytes in hex. Then the hex number
is converted to decimal and divided by 1024 to get
Kbytes.
• 9FFFF 9FFFF
• - 00000 + 00001
• 9FFFF A0000 hex = 655,360 decimal = 640K
9
Video display RAM (VDR) map
• To display information on the monitor of the PC,
• the CPU must first store that information in memory called video
display RAM (VDR);
• it is the job of the video controller to display it on the screen.
• Therefore, the address of the VDR must be within the CPU address
range.
• In the IBM PC, PS, and compatibles, from A0000 to BFFFFH, a total
of 128K bytes of the CPU's addressable memory is allocated for
video.
• Of that 128K, only a portion is used for VDR,
• the amount used depending on:
– which type of video adapter card is installed in the system;
– the mode that the video system used, text or graphics;
– and the resolution.
• For example, the monochrome video adapter uses only from B0000
up to 4K bytes of RAM, color graphics mode uses addresses
starting at B8000, and VGA has a starting address of A0000.
10
ROM memory map
• From C0000H to FFFFFH, a total of 256K bytes, is set
aside for ROM.
• Of these 256K bytes, some is used for BIOS ROM, some
for the BASIC language compiler ROM,
• some for the hard disk controller and other peripheral
board ROMs,
• and the rest for expansion by the user.
• The memory map for the 256K bytes allocated to ROM is
shown bellow:
11