Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Oran Garrity
vlsilab21_garrity_mikschl
Commits
40a8feb9
Commit
40a8feb9
authored
Mar 23, 2021
by
Manuel Mikschl
Browse files
lab#3_add1
parent
834fb1c7
Changes
2
Show whitespace changes
Inline
Side-by-side
src/add1_truthtable.vhd
View file @
40a8feb9
...
...
@@ -35,8 +35,12 @@ BEGIN
outputs_s
<=
"00"
WHEN
"000"
,
"10"
WHEN
"001"
,
-- fill in the missing lines here
-- ...
"10"
WHEN
"010"
,
"01"
WHEN
"011"
,
"10"
WHEN
"100"
,
"01"
WHEN
"101"
,
"01"
WHEN
"110"
,
"11"
WHEN
"111"
,
"XX"
WHEN
OTHERS
;
sum_o
<=
outputs_s
(
1
);
-- split vector elements ...
...
...
src/t_add1.vhd
View file @
40a8feb9
...
...
@@ -87,6 +87,49 @@ BEGIN -- tbench
-- fill in the missing stimuli here
-- ...
-- Test case: 011
b_i
<=
'1'
;
-- change value of b_i
a_i
<=
'1'
;
-- change value of a_i
WAIT
FOR
period
;
-- Observer:
ASSERT
sum_o
=
'0'
REPORT
"Error: sum is not correct !"
SEVERITY
failure
;
ASSERT
co_o
=
'1'
REPORT
"Error: co is not correct !"
SEVERITY
failure
;
---------------------------------------------------------------------------
-- Test case: 100
ci_i
<=
'1'
;
b_i
<=
'0'
;
-- change value of b_i
a_i
<=
'0'
;
-- change value of a_i
WAIT
FOR
period
;
-- Observer:
ASSERT
sum_o
=
'1'
REPORT
"Error: sum is not correct !"
SEVERITY
failure
;
ASSERT
co_o
=
'0'
REPORT
"Error: co is not correct !"
SEVERITY
failure
;
---------------------------------------------------------------------------
-- Test case: 101
a_i
<=
'1'
;
-- change value of a_i
WAIT
FOR
period
;
-- Observer:
ASSERT
sum_o
=
'0'
REPORT
"Error: sum is not correct !"
SEVERITY
failure
;
ASSERT
co_o
=
'1'
REPORT
"Error: co is not correct !"
SEVERITY
failure
;
---------------------------------------------------------------------------
-- Test case: 110
b_i
<=
'1'
;
-- change value of b_i
a_i
<=
'0'
;
-- change value of a_i
WAIT
FOR
period
;
-- Observer:
ASSERT
sum_o
=
'0'
REPORT
"Error: sum is not correct !"
SEVERITY
failure
;
ASSERT
co_o
=
'1'
REPORT
"Error: co is not correct !"
SEVERITY
failure
;
---------------------------------------------------------------------------
-- Test case: 111
a_i
<=
'1'
;
-- change value of a_i
WAIT
FOR
period
;
-- Observer:
ASSERT
sum_o
=
'1'
REPORT
"Error: sum is not correct !"
SEVERITY
failure
;
ASSERT
co_o
=
'1'
REPORT
"Error: co is not correct !"
SEVERITY
failure
;
---------------------------------------------------------------------------
WAIT
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment