@@ -25,21 +25,21 @@ architecture SimpleCircuit of LogicalStep_Lab2_top is
25
25
);
26
26
end component ;
27
27
28
- component concatenate port (
29
- hexA : in std_logic_vector (3 downto 0 );
28
+ component concatenate port (
29
+ hexA : in std_logic_vector (3 downto 0 ); -- concatenate hexA and hexB together
30
30
hexB : in std_logic_vector (3 downto 0 );
31
31
output : out std_logic_vector (7 downto 0 )
32
32
);
33
33
end component ;
34
34
35
35
component mux port (
36
- hex_in1, hex_in2 : in std_logic_vector (7 downto 0 );
36
+ hex_in1, hex_in2 : in std_logic_vector (7 downto 0 ); -- if selector button is pushed, 1 else 2
37
37
mux_select : in std_logic ;
38
38
hex_out : out std_logic_vector (7 downto 0 )
39
39
);
40
40
end component ;
41
41
42
- component segment7_mux port (
42
+ component segment7_mux port ( -- -
43
43
clk : in std_logic := '0' ;
44
44
DIN2 : in std_logic_vector (6 downto 0 );
45
45
DIN1 : in std_logic_vector (6 downto 0 );
@@ -49,14 +49,15 @@ architecture SimpleCircuit of LogicalStep_Lab2_top is
49
49
);
50
50
end component ;
51
51
52
- component add port (
52
+ component add port ( -- add hex A and hex B
53
53
hexA : in std_logic_vector (3 downto 0 );
54
54
hexB : in std_logic_vector (3 downto 0 );
55
55
output : out std_logic_vector (7 downto 0 )
56
56
);
57
57
end component ;
58
58
59
- component Logic_Processor is port (
59
+ component Logic_Processor is port (
60
+ -- depending on which button is pressed, different logic operator is applied to hexA and hexB
60
61
61
62
hexA : in std_logic_vector (3 downto 0 );
62
63
hexB : in std_logic_vector (3 downto 0 );
@@ -102,19 +103,21 @@ begin
102
103
103
104
-- seg7_data <= seg7_A;
104
105
106
+
107
+ -- ---------------- the add (7 segment control)----------------------------
105
108
106
109
107
110
INST1 : SevenSegment port map (arithmetic_Result(7 downto 4 ), seg7_A);
108
111
INST2 : SevenSegment port map (arithmetic_Result(3 downto 0 ), seg7_B);
109
112
INST3 : segment7_mux port map (clkin_50, seg7_B, seg7_A, seg7_data, seg7_char2, seg7_char1);
110
- INST4 : concatenate port map ( hex_B, hex_A, concatenationResult); -- swapped because of flipped display
113
+ INST4 : concatenate port map ( hex_B, hex_A, concatenationResult);
111
114
INST5 : add port map ( hex_B, hex_A, sumResult);
112
115
INST6 : mux port map (sumResult, concatenationResult, pb(3 ), arithmetic_Result);
113
116
114
117
118
+ -- --------------------------------------- the led control --------------------
115
119
116
-
117
- INST7 : Logic_Processor port map (hex_A, hex_B, pb (2 downto 0 ), logicOutput); -- reverted at the lower level
120
+ INST7 : Logic_Processor port map (hex_A, hex_B, pb (2 downto 0 ), logicOutput);
118
121
INST8 : mux port map (sumResult, logicOutput, pb(3 ), leds);
119
122
120
123
end SimpleCircuit ;
0 commit comments