当前位置:网站首页>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
边栏推荐
- Chapter 6 data flow modeling - after class exercises
- Service fusing hystrix
- Quick sort summary
- Detailed explanation of expression (csp-j 2021 expr) topic
- Maximum number of "balloons"
- To be continued] [UE4 notes] L4 object editing
- Haut OJ 1316: sister choice buys candy III
- Add level control and logger level control of Solon logging plug-in
- Acwing 4300. Two operations
- 剑指 Offer 05. 替换空格
猜你喜欢

Embedded database development programming (VI) -- C API

浅谈JVM(面试常考)
![[turn to] MySQL operation practice (I): Keywords & functions](/img/b1/8b843014f365b786e310718f669043.png)
[turn to] MySQL operation practice (I): Keywords & functions

读者写者模型

Bucket sort

Remote upgrade afraid of cutting beard? Explain FOTA safety upgrade in detail

利用HashMap实现简单缓存

一个新的微型ORM开源框架
![[merge array] 88 merge two ordered arrays](/img/e9/a73d9f22eead8e68c1e45c27ff6e6c.jpg)
[merge array] 88 merge two ordered arrays
![[to be continued] [UE4 notes] L2 interface introduction](/img/0f/268c852b691bd7459785537f201a41.jpg)
[to be continued] [UE4 notes] L2 interface introduction
随机推荐
[es practice] use the native realm security mode on es
剑指 Offer 53 - I. 在排序数组中查找数字 I
发现一个很好的 Solon 框架试手的教学视频(Solon,轻量级应用开发框架)
Haut OJ 1401: praise energy
游戏商城毕业设计
room数据库的使用
[to be continued] I believe that everyone has the right to choose their own way of life - written in front of the art column
浅谈JVM(面试常考)
[to be continued] [UE4 notes] L2 interface introduction
Bucket sort
Zzulioj 1673: b: clever characters???
Hang wait lock vs spin lock (where both are used)
TF-A中的工具介绍
Haut OJ 1221: a tired day
C语言杂谈1
To the distance we have been looking for -- film review of "flying house journey"
xftp7与xshell7下载(官网)
Merge sort
kubeadm系列-00-overview
[轉]: OSGI規範 深入淺出