Skip to content

Commit 7ecdda4

Browse files
committed
components
1 parent 53e80f4 commit 7ecdda4

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
library ieee;
2+
use ieee.std_logic_1164.all;
3+
4+
5+
-- bit_multiplier based on the book: VHDL: Modular Design and Synthesis of Cores
6+
-- and Systems on page 307.
7+
entity bit_multiplier is
8+
port (
9+
x_in, y_in, p_in, c_in : in std_logic;
10+
x_out, y_out, p_out, c_out : out std_logic
11+
);
12+
end entity;
13+
14+
15+
architecture rtl of bit_multiplier is
16+
signal xy : std_logic;
17+
begin
18+
xy <= x_in and y_in;
19+
c_out <= (p_in and xy) or (p_in or c_in) or (xy or c_in);
20+
p_out <= p_in xor xy xor c_in;
21+
-- Wire inputs bits right to output bits for chaining.
22+
x_out <= x_in;
23+
y_out <= y_in;
24+
end architecture;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
-- TODO: Write test bench using VUnit.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
builder = msim
2+
target_dir = .build
3+
4+
vhdl work bit_multiplier.vhd -2002

0 commit comments

Comments
 (0)