Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
INT_my_epic_calculator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Snijder, T. (Taya, Student M-EMSYS)
INT_my_epic_calculator
Merge requests
!20
moved adder to module to share resources
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
moved adder to module to share resources
taya_branch
into
main
Overview
0
Commits
1
Pipelines
0
Changes
5
Merged
Snijder, T. (Taya, Student M-EMSYS)
requested to merge
taya_branch
into
main
4 months ago
Overview
0
Commits
1
Pipelines
0
Changes
5
Expand
0
0
Merge request reports
Compare
main
main (base)
and
latest version
latest version
17b82815
1 commit,
4 months ago
5 files
+
121
−
27
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
5
Search (e.g. *.vue) (Ctrl+P)
alu/adder.vhd
0 → 100644
+
44
−
0
Options
-- library and package declarations
library
ieee
;
use
ieee
.
std_logic_1164
.
all
;
use
ieee
.
numeric_std
.
all
;
entity
adder
is
generic
(
word_length
:
integer
:
=
32
);
port
(
clk
:
in
std_logic
;
in_A
:
in
std_logic_vector
(
word_length
-1
downto
0
);
in_B
:
in
std_logic_vector
(
word_length
-1
downto
0
);
do_add
:
in
std_logic
;
adder_out
:
out
std_logic_vector
(
word_length
-1
downto
0
)
);
end
entity
adder
;
architecture
rtl
of
adder
is
signal
operand_A
:
signed
(
word_length
-1
downto
0
);
signal
operand_B
:
signed
(
word_length
-1
downto
0
);
signal
carry_in
:
unsigned
(
0
downto
0
);
begin
comb
:
process
(
do_add
,
in_A
,
in_B
)
begin
if
do_add
=
'1'
then
operand_A
<=
signed
(
in_A
);
operand_B
<=
signed
(
in_B
);
carry_in
<=
to_unsigned
(
0
,
1
);
else
operand_A
<=
signed
(
not
(
in_A
));
operand_B
<=
signed
(
in_B
);
carry_in
<=
to_unsigned
(
1
,
1
);
end
if
;
end
process
comb
;
adder_out
<=
std_logic_Vector
(
unsigned
(
operand_A
+
operand_B
)
+
carry_in
);
end
architecture
rtl
;
Loading