3.3.2 4-bit Write Port Width

Consider the following Intel HEX memory file.

Figure 3-10. Memory File Data - Intel HEX Memory File

The binary stream of bits for above memory file data is:

If the memory port width is 4 bits, the tool reads 8 bits at a time from the binary stream above. For the 8 bits, you must pad zeros for the upper 4 bits and specify the actual data in the lower 4 bits, as shown in the following figure.
Figure 3-11. Padding Zeros for the Upper 4 Bits and Specifying Data in the Lower 4 Bits

The following figure shows the equivalent memory file data padded with zeros to achieve a 4-bit write port width.

Figure 3-12. Equivalent Memory File Data Padded with Zeros (4-bit Write Port Width)

When the tool parses the above memory file data (padded with zeros), it converts the data to binary and reads it as a stream of bits. If the port width is 4 bits, the tool reads 8 bits (byte-aligned), ignores the upper 4 bits of actual data, and stores the lower 4 bits of actual data in RAM, as shown in the following table.

Table 3-2. 16-bit Write Port Width
AddressData
00xF
10xF
20x1
30x1
40xE
50xE
60x2
70x2
80xD
90xD
A0x3
B0x3
C0xC
D0xC
E0x4
F0x4
100xB
110xB
120x5
130x5
140x0
150x0
160x2
170x1
Note: x1 and x2 port widths are handled using the same technique of padding zeros. You always zero pad to the next 8-bit-width increment (8, 16, 24, and so on). If a write port width is not aligned on a byte boundary, the following message appears.
Figure 3-13. Message when a Write Port Width is Not Aligned on a Byte Boundary