Altera Internal Memory (RAM and ROM) IP Core User Manual
Page 19

You can specifically define and set the size of a byte for the byte-enable port. The valid values are 5, 8, 9,
and 10, depending on the type of embedded memory blocks. The values of 5 and 10 are only supported by
MLAB. To enable byte enable for port A and port B, the data width ratio has to be 1 or 2 for the RAM: 1-
PORT and RAM: 2-PORT IP cores.
Note: To enable byte enable for port A and port B, the data width ratio has to be 1 or 2 for the RAM: 1-
PORT and RAM: 2-PORT IP cores.
To create a byte-enable port, the width of the data input port must be a multiple of the size of a byte for
the byte-enable port. For example, if you use an MLAB memory block, the byte enable is only supported if
your data bits are multiples of 5, 8, 9 or 10, that is 10, 15, 16, 18, 20, 24, 25, 27, 30, and so on. If the width
of the data input port is 10, you can only define the size of a byte as 5. In this case, you get a 2-bit byte-
enable port, each bit controls 5 bits of data input written. If the width of the data input port is 20, then you
can define the size of a byte as either 5 or 10. If you define 5 bits of input data as a byte, you get a 4-bit
byte-enable port, each bit controls 5 bits of data input written. If you define 10 bits of input data as a byte,
you get a 2-bit byte-enable port, each bit controls 10 bits of data input written.
Figure 3-6: Byte Enable Functional Waveform
This figure shows the results of the byte enable on the data that is written into the memory, and the data
that is read from the memory.
inclock
wren
address
data
q (asynch)
an
XXXX
a0
a1
a2
a0
a1
a2
doutn
ABFF
FFCD
ABCD
ABFF
FFCD
ABCD
byteena
XX
10
01
11
XXXX
XX
ABCD
ABCD
FFFF
FFFF
FFFF
ABFF
FFCD
contents at a0
contents at a1
contents at a2
rden
For this functional waveform, New Data Mode is selected.
When a byte-enable bit is deasserted during a write cycle, the corresponding masked byte of the q output
can appear as a “Don't Care” value or the current data at that location. This selection is only available if
you set the read-during-write output behavior to New Data.
UG-01068
2014.12.17
Byte Enable
3-9
Embedded Memory Functional Description
Altera Corporation