-
Notifications
You must be signed in to change notification settings - Fork 0
/
MatMul.vhd
55 lines (36 loc) · 826 Bytes
/
MatMul.vhd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
library IEEE;
use IEEE.NUMERIC_STD.ALL;
use IEEE.STD_LOGIC_1164.ALL;
ENTITY MaxMul IS
PORT(
Enable : IN STD_LOGIC;
Loaded : IN STD_LOGIC;
DONE : OUT STD_LOGIC;
InM1 : IN STD_LOGIC_VECTOR(7 DOWNTO 0);
InM2 : IN STD_LOGIC_VECTOR(7 DOWNTO 0);
OutM3 : OUT STD_LOGIC_VECTOR(15 DOWNTO 0);
Clk : IN STD_LOGIC
);
END ENTITY;
ARCHITECTURE max of MaxMul IS
TYPE states is (IDLE,START,MULTIPLY,DONE);
SIGNAL c_sta, n_sta : states :=IDLE;
BEGIN
FSM : PROCESS(Clk, Enable,Loaded)
BEGIN
IF ( Enable = '0') THEN
c_sta <= IDLE;
n_sta <= IDLE;
DONE <= '0';
ELSIF( Loaded = '1') THEN
n_stat <= start;
ENDIF;
IF( rising_edge(Clk)) THEN
c_sta <= n_sta;
ENDIF;
END PROCESS;
LOGIC: PROCESS(c_state, Loaded, InM1, InM2 )
VARIABLE count :natural range 0 to 1920;
BEGIN
END PROCESS;
END max;