ALU代表什么呀ALU是什么呀,它代表什么呀,

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/29 11:45:11
ALU代表什么呀ALU是什么呀,它代表什么呀,
xU[OG+#lu}ZMRT)TS4;N]͌A pM-Ih -~(418ӝԿ36V݇ϙ]z~m+,8'L_Bh:\rcx?aeQ)8򫻍g ,r=CFU h9PE{ZX,tRnʬ|Zqp^e^-GK1鲜꒜y#WG;pl< ŊUXg?,4X݋4T~ފOVA?L0{\b|6!-~Npӧۍ݇I-n%FGЁAX:Pr9hԚ`o5O ]Rol' .+dL$_?Z]"t1~uV ]a9Dry]]0V3 Foӓ8s io!x$jd(eaLiKs|_}>8|UW*Ԧ cƎ֦kaOpԕW\Cz~ d`̩=t i Y4o ѐ@y.,"&u4paiHC6 vL4zaX!$9ι 8@TDAT82Y/x,6fSBz"OJsaލчil7y  F|62645uʆJeQM;zt'h6A‘2:L8͏ݐs{vagG%wb[ EU u;%$OX0%#{úM vM.20WK@h"fբʋZb\vl6y=eWkh ޻&d*=q\W8[ bsrm>` ]`vۋTajr)L_;hs{3Nc JJ,

ALU代表什么呀ALU是什么呀,它代表什么呀,
ALU代表什么呀
ALU是什么呀,它代表什么呀,

ALU代表什么呀ALU是什么呀,它代表什么呀,
计算机中的ALU
ALU: (Arithmetic Logic Unit,算术逻辑单元)在处理器CPU之中用于计算的那一部分,与其同级的有数据传输单元和分支单元.ALU负责处理数据的运算工作,包括算术运算起(如:加、减、乘、除等),逻辑运算(如:AND、OR、NOT..等)及关系运算(比较大小等关系),并将运算的结果存回记忆单元.
下面举例8位ALU的两种设计方案.
使用原理图方法设计:
http://patrick.wagstrom.net/projects/academic/iiter/schematics/8alu.html
使用VHDL方法设计:
8-Bit ALU in VHDL
This arithmetic logic unit accepts 8-bit inputs, but it can easily be modded to higher bits. It supports the addition, subtraction, set if less than, AND, and OR operations. The operation to perform is determined by the 3-bit address bus.
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.std_logic_arith.all;
ENTITY alu8bit IS
port(a, b : in std_logic_vector(7 downto 0); -- a and b are busses
op : in std_logic_vector(2 downto 0);
zero : out std_logic;
f : out std_logic_vector(7 downto 0));
END alu8bit;
architecture behavioral of alu8bit is
begin
process(op)
variable temp: std_logic_vector(7 downto 0);
begin
case op is
when "000" =>
temp := a and b;
when "100" =>
temp := a and b;
when "001" =>
temp := a or b;
when "101" =>
temp := a or b;
when "010" =>
temp := a + b;
when "110" =>
temp := a - b;
when "111" =>
if a < b then
temp := "11111111";
else
temp := "00000000";
end if;
when others =>
temp := a - b;
end case;
if temp="00000000" then
zero