symlet
Member level 1
- Joined
- Oct 12, 2012
- Messages
- 41
- Helped
- 1
- Reputation
- 2
- Reaction score
- 1
- Trophy points
- 1,288
- Activity points
- 1,616
Hai all,
I have confusion with resize function in vhdl. I have write a line of code as below:
When I check the result in testbench (Modelsim), the value of dcto_1 is 384. However, I aspect the value will be 256 (128+128). I attach the figure,hope anyone can figure it out for me. Thanks in advance.
I have confusion with resize function in vhdl. I have write a line of code as below:
Code:
if even_not_odd = '0' then
dcto_1 <= STD_LOGIC_VECTOR(RESIZE
(RESIZE(SIGNED(romedatao(0)),DA_W) +
(RESIZE(SIGNED(romedatao(1)),DA_W-1) & '0'),
DA_W));
When I check the result in testbench (Modelsim), the value of dcto_1 is 384. However, I aspect the value will be 256 (128+128). I attach the figure,hope anyone can figure it out for me. Thanks in advance.