[SOLVED] is this code correct and what does this code do?

Status
Not open for further replies.

Fractional-N

Full Member level 1
Joined
Oct 15, 2007
Messages
97
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,288
Visit site
Activity points
2,071
is this VHDL code correct and what does this code do?

hi,
here is a VHDL code, can anyone explain it to me, please? i think it is somewhat strange and it could be written in only 3 line! (max) why there is more lines?


Code VHDL - [expand]
1
2
3
4
5
6
if (CLK' event and CLK = '1') then
    if ((DATA = '1') or (DATA_EN = '0')) then
        ID(7 downto 0)  <= DATA_IN;
        ID(15 downto 8) <= ID(7 downto 0);
        DATA_OUT        <= ID(15 downto 8);
    end if;

 
Last edited by a moderator:

It's syntactically correct and synthesizable VHDL. If it's correct in terms of the intended function can't be said without knowing the specification.

If you have problems to "see" the implemented function, draw the hardware. There are 3 8-bit registers with clock and clock enable.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…