Выбрать главу

A worked example

The eight memory chips were now changed to 1 kbyte chips. Some data is stored in the address 4000H. Find (a) how many image addresses will occur and (b) the image addresses.

(a) A 1 kbyte memory chip would have 10 address lines. This was taken from Table 7.1 and the decoder chip still needs three inputs. The 16-bit address we were given, 4000H would result in three unused lines as in Table 7.5. These three binary digits can take on the values 000, 001, 010, 011, 100, 101, 110 and 111 which results in eight different values. This could have been done the slick way by saying 2³=8. Putting these eight numbers into the address will result in eight different addresses.

One real address and seven ghosts or images. But which is the ghost and which is the real one? It doesn’t matter. We can assume anything we like since they all point to the same physical memory. Having said this, most people seem to opt for the lowest address as the ‘real’ one.

Table 7.5 There are now three unused address lines A

A15 A14 A13 A12 A11 A10 A9 A8 A7 A6 A5 A4 A3 A2 A1 A0
0 1 0 1 1 0 0 0 1 0 1 0 0 1 0 1
←To the decoder→ ↑Three unused lines↑ ←To the 1 kbyte memory chip→

(b) Now, to find the actual ghost addresses, all we have to do is to feed in all the binary options, 000, 001 etc. into the ‘real’ address to generate each of the ghost addresses. This is shown in Table 7.6.

Table 7.6 Generating the image addresses

A15 A14 A13 A12 A11 A10 A9 A8 A7 A6 A5 A4 A3 A2 A1 A0 Address
0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4000
0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 4400
0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 4800
0 1 0 0 1 1 0 0 0 0 0 0 0 0 0 0 4C00
0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 5000
0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 5400
0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 5800
0 1 0 1 1 1 0 0 0 0 0 0 0 0 0 0 5C00

The resulting addresses are 4000H, 4400H, 4800H, 4C00H, 5000H, 5400H, 5800H and 5C00H. Strictly speaking, we should, perhaps, only give the last seven addresses since the question asked for the image addresses and the first one is actually the real address. Notice how the addresses increase in a definite pattern. It always works out this way.

Image addresses and the memory map

You may remember the memory maps that we looked at in the last chapter. They showed the addresses taken by the various memory devices and the unused addresses in between them. When we have partial decoding, it gives rise to image addresses. Now, if we put these image addresses on the memory map a curious thing occurs. Every image address always falls in one of the unused areas on the map so they will never cause problems by clashing with an existing memory chip.

Quiz time 7

In each case, choose the best option.

1 The Digital Alpha 21064 microprocessor has a 34-bit address bus which can access a memory of:

(a) 64 Gbytes.

(b) 64 Mbytes.

(c) 16 Gbytes.

(d) 160 Mbytes.

2 The data bus:

(a) is bi-directional.

(b) consists of eight conductors.

(c) can be used to carry data to RAM and ROM memory chips.

(d) is connected to the chip select pins.

3 A 16-bit address bus is carrying the address 4567H and is partially decoded with lines A15 and A13 being unused. Which one of these addresses would access a different hardware location:

(a) E567H.

(b) 4567H.

(c) 6567H.

(d) 8567H.

4 Which one of the following is NOT essential in a microprocessor-based system:

(a) an address bus.

(b) ROM.

(c) a clock signal.

(d) RAM.

5 Image addresses are:

(a) also called ghost addresses.

(b) due to several hardware addresses pointing to the same software address.

(c) the same as partial addresses.

(d) caused by full decoding.

8. A typical 8-bit microprocessor

The 8-bit microprocessor is described in some detail to provide a foundation upon which others can be built since the story of microprocessors is one of evolution rather than ‘bolts out of the blue’.

An 8-bit microprocessor – the Z80180

This microprocessor is the modern version of an old favorite called the Z80 which was developed in 1978 which was itself just an improved version of the Intel 8080. There are many similarities since some of the engineers that designed the 8080 left Intel and went to work for Zilog to build the Z80 which proved to be one of the most popular and longest living microprocessors – it is still widely used even in mobile phones.

When Zilog developed the Z80180, they were naturally anxious to hold on to their previous customers by making the new version compatible with the earlier Z80. This allows customers an easy and inexpensive way of updating their system without the high design costs of starting afresh with a completely different device.