Altera_Forum
Honored Contributor
8 years agoTrying to generate a signal.
Hello :)
I am really new with VHDL, I am doing my thesis coding in it, and I am stuck in some parts, so maybe someone could help me? I have created an optimized 4x4 bits multiplier, and i need to extract the results from that. I mean: A3A2A1A0 X B3B2B1B0 = C3C2C1C0 D3D2D1D0 0000 x 0001 = 0000 0000 1010 x 1010 = 0010 1010 So, I am trying to create signals from 0 0 to 9 9 for my multiplier in wthis way: --- Quote Start --- library std; LIBRARY ieee; use std.textio.all; USE ieee.std_logic_1164.all; entity TBMULT is port(a3,a2,a1,a0,b3,b2,b1,b0 : OUT STD_LOGIC); end TBMULT; architecture Behavioral of TBMULT is signal first, second : std_LOGIC_VECTOR (3 downto 0); signal clock : bit := '0'; begin clock <= not (clock) after 0.5 ns; process (clock) begin for i in 0 to 9 loop for j in 0 to 9 loop CASE I IS when 0 => first <= "0000"; when 1 => first <= "0001"; when 2 => first <= "0010"; when 3 => first <= "0011"; when 4 => first <= "0100"; when 5 => first <= "0101"; when 6 => first <= "0110"; when 7 => first <= "0111"; when 8 => first <= "1000"; when others => first <= "1001"; end case; CASE J IS when 0 => second <= "0000"; when 1 => second <= "0001"; when 2 => second <= "0010"; when 3 => second <= "0011"; when 4 => second <= "0100"; when 5 => second <= "0101"; when 6 => second <= "0110"; when 7 => second <= "0111"; when 8 => second <= "1000"; when others => second <= "1001"; end case; a3 <= first(3); a2 <= first(2); a1 <= first(1); a0 <= first(0); b3 <= second(3); b2 <= second(2); b1 <= second(1); b0 <= second(0); end loop; end loop; end process; end Behavioral; --- Quote End --- I wire it to my multiplier in this way: https://alteraforum.com/forum/attachment.php?attachmentid=14522&stc=1 But when i simulate it, i only get 1000 0001 (81) the result from 9*9, and I was specting all the multiplications. Any hints?