当前位置:网站首页>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
边栏推荐
- Binary search basis
- Corridor and bridge distribution (csp-s-2021-t1) popular problem solution
- [转]:Apache Felix Framework配置属性
- [merge array] 88 merge two ordered arrays
- 数仓项目的集群脚本
- [es practice] use the native realm security mode on es
- 挂起等待锁 vs 自旋锁(两者的使用场合)
- [转]: OSGI规范 深入浅出
- SAP method of modifying system table data
- 记录QT内存泄漏的一种问题和解决方案
猜你喜欢
随机推荐
剑指 Offer 53 - II. 0~n-1中缺失的数字
YOLOv5添加注意力機制
Palindrome (csp-s-2021-palin) solution
Es module and commonjs learning notes -- ESM and CJS used in nodejs
[to be continued] [UE4 notes] L3 import resources and project migration
Embedded database development programming (V) -- DQL
Yolov5 ajouter un mécanisme d'attention
游戏商城毕业设计
Es module and commonjs learning notes
The number of enclaves
Haut OJ 2021 freshmen week II reflection summary
第六章 数据流建模—课后习题
Little known skills of Task Manager
Development error notes
[to be continued] [UE4 notes] L1 create and configure items
Using HashMap to realize simple cache
Demonstration of using Solon auth authentication framework (simpler authentication framework)
读者写者模型
剑指 Offer 05. 替换空格
PMP candidates, please check the precautions for PMP examination in July




![[转]MySQL操作实战(一):关键字 & 函数](/img/b1/8b843014f365b786e310718f669043.png)
![[interval problem] 435 Non overlapping interval](/img/a3/2911ee72635b93b6430c2efd05ec9a.jpg)



