URL
https://opencores.org/ocsvn/tv80/tv80/trunk
[/] [tv80/] [trunk/] [rtl/] [core/] [tv80_alu.v] - Diff between revs 84 and 90
Show entire file |
Details |
Blame |
View Log
Rev 84 |
Rev 90 |
Line 56... |
Line 56... |
input [3:0] A;
|
input [3:0] A;
|
input [3:0] B;
|
input [3:0] B;
|
input Sub;
|
input Sub;
|
input Carry_In;
|
input Carry_In;
|
begin
|
begin
|
AddSub4 = { 1'b0, A } + { 1'b0, (Sub)?~B:B } + Carry_In;
|
AddSub4 = { 1'b0, A } + { 1'b0, (Sub)?~B:B } + {4'h0,Carry_In};
|
end
|
end
|
endfunction // AddSub4
|
endfunction // AddSub4
|
|
|
function [3:0] AddSub3;
|
function [3:0] AddSub3;
|
input [2:0] A;
|
input [2:0] A;
|
input [2:0] B;
|
input [2:0] B;
|
input Sub;
|
input Sub;
|
input Carry_In;
|
input Carry_In;
|
begin
|
begin
|
AddSub3 = { 1'b0, A } + { 1'b0, (Sub)?~B:B } + Carry_In;
|
AddSub3 = { 1'b0, A } + { 1'b0, (Sub)?~B:B } + {3'h0,Carry_In};
|
end
|
end
|
endfunction // AddSub4
|
endfunction // AddSub4
|
|
|
function [1:0] AddSub1;
|
function [1:0] AddSub1;
|
input A;
|
input A;
|
input B;
|
input B;
|
input Sub;
|
input Sub;
|
input Carry_In;
|
input Carry_In;
|
begin
|
begin
|
AddSub1 = { 1'b0, A } + { 1'b0, (Sub)?~B:B } + Carry_In;
|
AddSub1 = { 1'b0, A } + { 1'b0, (Sub)?~B:B } + {1'h0,Carry_In};
|
end
|
end
|
endfunction // AddSub4
|
endfunction // AddSub4
|
|
|
// AddSub variables (temporary signals)
|
// AddSub variables (temporary signals)
|
reg UseCarry;
|
reg UseCarry;
|
© copyright 1999-2025
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.