How to add COUNT value

greenspun.com : LUSENET : ece342 : One Thread

COUNT holds the number of words to be transferred. How do we multiply the value in COUNT by 2 or add COUNT to itself in VHDL in order to get the number of bytes??

-- ADD (addition@ecf.toronto.edu), February 23, 1999

Answers

Just shift it left by one bit position. If you recall from Comp. Org., the LSL instruction is the same as MULT #2,

-- Julian C. Dunn (jdunn@aquezada.com), February 23, 1999.

Julian is correct, a left-shift by one bit is a multiplication by 2. However you don't even need to do this. You have 7 Count bits which correspond to ADDR(7 downto 1), so just connect them directly to those bits. (I.e Count doesn't drive ADDR(0).) Since you only do word operations, the implicit ADDR(0) is encoded in the fact that you always drive both /UDS and /LDS.

Robin

-- Robin Grindley (grindley@eecg.toronto.edu), February 23, 1999.


Moderation questions? read the FAQ