M
Morfeusz
Guest
Hi,
I'm new in vhdl. I/m trying to make some simple project using
alliance.
The device has 3 inputs A(7 to 0), B(7 to 0) and s (1 to 0). All the
results should be stored in Q register.
s opertation
00 A+B
11 Q+2
There is my source code:
---------------------------------------
ENTITY ue IS
PORT(
-- 8 bits A
A: IN BIT_VECTOR(7 DOWNTO 0);
-- 8 bits B
B: IN BIT_VECTOR(7 DOWNTO 0);
-- 9 bits Y
Y: OUT BIT_VECTOR(7 DOWNTO 0);
-- 2 bits
s: IN BIT_VECTOR(1 DOWNTO 0);
-- zegar
clk: IN BIT;
vdd: IN BIT;
vss: IN BIT
);
END ue;
ARCHITECTURE data_flow OF ue IS
SIGNAL wyj_sum: BIT_VECTOR(7 DOWNTO 0);
SIGNAL wyjscie: BIT_VECTOR(7 DOWNTO 0);
SIGNAL wyj_plu: BIT_VECTOR(7 DOWNTO 0);
SIGNAL przen: BIT_VECTOR(8 DOWNTO 0);
SIGNAL przen_3: BIT_VECTOR(8 DOWNTO 0);
SIGNAL Q: REG_VECTOR (7 DOWNTO 0) REGISTER;
CONSTANT dwa :BIT_VECTOR(7 DOWNTO 0):="00000010";
BEGIN
WITH s SELECT
wyjscie <= wyj_sum WHEN "00",
wyj_plu WHEN "11";
-- A+B
wyj_sum <= A XOR B XOR przen(7 DOWNTO 0);
przen(0) <= '0';
przen(8 DOWNTO 1) <= (A AND przen(7 DOWNTO 0)) OR (B AND przen(7
DOWNTO 0)) OR (A AND B);
--Q+2
wyj_plu <= Q XOR dwa XOR przen_3(7 DOWNTO 0);
przen_3(0) <= '0';
przen_3(8 DOWNTO 1) <= (Q AND przen_3(7 DOWNTO 0)) OR (dwa AND
przen_3(7 DOWNTO 0)) OR (Q AND dwa);
write: BLOCK (clk = '1' AND clk'STABLE)
BEGIN
Q <= GUARDED wyjscie;
END BLOCK;
Y <= Q;
END;
------------------------------------
The project compiles with no errors, but but while checking it (asimut
-b project pat out) computer hangs.
pat file is:
----------------------------------------
in A(7 to 0);
in B(7 to 0);
in s(1 to 0);
in clk;
out Y(7 to 0);
begin
pat_1: 00000101 00000011 00 1 ? ********;
pat_2: 00001000 00001110 11 1 ? ********;
end;
-----------------------------------------
I think that there is a problem with Q+2 operation, but I don't know
how to fix it.
Could you please help me?
Thanks
Morfi
I'm new in vhdl. I/m trying to make some simple project using
alliance.
The device has 3 inputs A(7 to 0), B(7 to 0) and s (1 to 0). All the
results should be stored in Q register.
s opertation
00 A+B
11 Q+2
There is my source code:
---------------------------------------
ENTITY ue IS
PORT(
-- 8 bits A
A: IN BIT_VECTOR(7 DOWNTO 0);
-- 8 bits B
B: IN BIT_VECTOR(7 DOWNTO 0);
-- 9 bits Y
Y: OUT BIT_VECTOR(7 DOWNTO 0);
-- 2 bits
s: IN BIT_VECTOR(1 DOWNTO 0);
-- zegar
clk: IN BIT;
vdd: IN BIT;
vss: IN BIT
);
END ue;
ARCHITECTURE data_flow OF ue IS
SIGNAL wyj_sum: BIT_VECTOR(7 DOWNTO 0);
SIGNAL wyjscie: BIT_VECTOR(7 DOWNTO 0);
SIGNAL wyj_plu: BIT_VECTOR(7 DOWNTO 0);
SIGNAL przen: BIT_VECTOR(8 DOWNTO 0);
SIGNAL przen_3: BIT_VECTOR(8 DOWNTO 0);
SIGNAL Q: REG_VECTOR (7 DOWNTO 0) REGISTER;
CONSTANT dwa :BIT_VECTOR(7 DOWNTO 0):="00000010";
BEGIN
WITH s SELECT
wyjscie <= wyj_sum WHEN "00",
wyj_plu WHEN "11";
-- A+B
wyj_sum <= A XOR B XOR przen(7 DOWNTO 0);
przen(0) <= '0';
przen(8 DOWNTO 1) <= (A AND przen(7 DOWNTO 0)) OR (B AND przen(7
DOWNTO 0)) OR (A AND B);
--Q+2
wyj_plu <= Q XOR dwa XOR przen_3(7 DOWNTO 0);
przen_3(0) <= '0';
przen_3(8 DOWNTO 1) <= (Q AND przen_3(7 DOWNTO 0)) OR (dwa AND
przen_3(7 DOWNTO 0)) OR (Q AND dwa);
write: BLOCK (clk = '1' AND clk'STABLE)
BEGIN
Q <= GUARDED wyjscie;
END BLOCK;
Y <= Q;
END;
------------------------------------
The project compiles with no errors, but but while checking it (asimut
-b project pat out) computer hangs.
pat file is:
----------------------------------------
in A(7 to 0);
in B(7 to 0);
in s(1 to 0);
in clk;
out Y(7 to 0);
begin
pat_1: 00000101 00000011 00 1 ? ********;
pat_2: 00001000 00001110 11 1 ? ********;
end;
-----------------------------------------
I think that there is a problem with Q+2 operation, but I don't know
how to fix it.
Could you please help me?
Thanks
Morfi