0% found this document useful (0 votes)
7 views1 page

Alu

Uploaded by

Shubham Bansal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views1 page

Alu

Uploaded by

Shubham Bansal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

//////////////////////////////////////////////////////////////////////////////////

// Company:
// Engineer:
//
// Create Date: 08.05.2021 12:39:16
// Design Name:
// Module Name: alu
// Project Name:
// Target Devices:
// Tool Versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
//////////////////////////////////////////////////////////////////////////////////
`timescale 1 ns / 1 ps
module alu( input [7:0] A,
input [7:0] B,
input alu_cl,
output reg [7:0] Result,
output reg zero);
always@(*)
begin
case(alu_cl)
1'b0:
begin
Result= A+B;
if(Result==0)
zero=1'b1;
else
zero=1'b0;
end
1'b1:
begin
Result= B;
if(Result==0)
zero=1'b1;
else
zero=1'b0;
end

default:
begin
Result=8'bx;
zero=1'bx;
end
endcase
end
endmodule

You might also like