-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMyChip.Vhd
More file actions
59 lines (49 loc) · 1.9 KB
/
MyChip.Vhd
File metadata and controls
59 lines (49 loc) · 1.9 KB
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
56
57
58
59
--*******************************************************************************
-- MyChip
-- Designer: Scott Tippens
--
-- Wrapper for MirrorSegments Project to map Basys3 resources to MirrorSegments
-- ports. We will be using the 4 right most slide switches for the value input.
-- The center button on the digital button pad will be our mode input and we will
-- use the right most 7-segment display for our digit.
--
--*******************************************************************************
library ieee;
use ieee.std_logic_1164.all;
entity MyChip is
port (
sw: in std_logic_vector(3 downto 0); --slide switch inputs
btnC: in std_logic; --center button digtital pad
seg: out std_logic_vector (6 downto 0); --segments for 7-seg displays
an: out std_logic_vector (3 downto 0)); --anodes for 7-seg displays
end MyChip;
architecture MyChip_ARCH of MyChip is
-------------------------------------------------------------------CONSTANTS
constant SELECT_RIGHT_7SEG_DISPLAY: std_logic_vector(3 downto 0) := "1110";
--mirrored-segment-driver------------------------------------------COMPONENT
component MirroredSegments
port(
value: in std_logic_vector(3 downto 0);
mode: in std_logic;
sevenSeg: out std_logic_vector(6 downto 0)
);
end component;
--internal connections-----------------------------------------------SIGNALS
signal sevenSeg: std_logic_vector(6 downto 0);
begin
an <= SELECT_RIGHT_7SEG_DISPLAY;
--reverse-bit-order-for-segments-to-match-Basys3-connections----------------
seg(0) <= sevenSeg(6);
seg(1) <= sevenSeg(5);
seg(2) <= sevenSeg(4);
seg(3) <= sevenSeg(3);
seg(4) <= sevenSeg(2);
seg(5) <= sevenSeg(1);
seg(6) <= sevenSeg(0);
--segment-driver---------------------------------------------------COMPONENT
SEGMENT_DRIVER: MirroredSegments port map (
value => sw,
mode => btnC,
sevenSeg => sevenSeg
);
end MyChip_ARCH;