当前位置:网站首页>Alu logic operation unit
Alu logic operation unit
2022-07-05 05:28:00 【Li Junfeng】
ALU Logical unit of operation
according to ( Two ) Medium to single cycle CPU The definition of , This module needs to realize the following 4 Class operation : Add 、 reduce 、 Bitwise AND 、 Press bit or . Therefore need 2 bit The control signal of Aluc To control ALU Operation type of .
Correspondence of signals :
surface 4 1 Aluc Coding and corresponding functions
Aluc code Realization function Arithmetic type
00 Add Arithmetic operation
01 reduce Arithmetic operations
10 Bitwise AND Logical operations
11 Press bit or Logical operations
Addition and subtraction can be used 32 Bit full adder ADDSUB_32 Realization , Bitwise and used AND32, Bit by bit or used OR32, The choice of function uses 32 Bit two choose one multi-channel selector MUX2X32 Realization , Returned the result R, as well as ALU Whether the operation result of is 0 The judgment of the Z( if R=0,Z=1;),Z Mainly for beq、bne Instructions .
Code
module ALU(X,Y,Aluc,R,Z);
input [31:0]X,Y;
input [1:0] Aluc;
output [31:0]R;
output Z;
wire [31:0]d_as,d_and,d_or,d_and_or;
ADDSUB_32 as32(X,Y,Aluc[0],d_as);
AND32 a32(X,Y,d_and);
OR32 o32(X,Y,d_or);
MUX2X32 select1(d_and,d_or,Aluc[0],d_and_or);
MUX2X32 select2(d_as,d_and_or,Aluc[1],R);
isZero i1(R,Z);
endmodule
边栏推荐
猜你喜欢
随机推荐
游戏商城毕业设计
kubeadm系列-01-preflight究竟有多少check
Summary of Haut OJ 2021 freshman week
一个新的微型ORM开源框架
Romance of programmers on Valentine's Day
A problem and solution of recording QT memory leakage
Double pointer Foundation
对象的序列化
Demonstration of using Solon auth authentication framework (simpler authentication framework)
[turn]: Apache Felix framework configuration properties
lxml. etree. XMLSyntaxError: Opening and ending tag mismatch: meta line 6 and head, line 8, column 8
Pointnet++的改进
Csp-j-2020-excellent split multiple solutions
剑指 Offer 53 - I. 在排序数组中查找数字 I
[merge array] 88 merge two ordered arrays
On-off and on-off of quality system construction
lxml.etree.XMLSyntaxError: Opening and ending tag mismatch: meta line 6 and head, line 8, column 8
Detailed explanation of expression (csp-j 2021 expr) topic
PMP candidates, please check the precautions for PMP examination in July
Service fusing hystrix






![[转]: OSGI规范 深入浅出](/img/54/d73a8d3e375dfe430c2eca39617b9c.png)


