Documente Academic
Documente Profesional
Documente Cultură
INTRODUCTION
(GPUs)
HISTORY
Hungarian-American
pure
and
applied
mathematician,
physicist, and polymath, John von Neumann, proposed the ALU
concept in 1945, when he wrote a report on the foundations for
a new computer called the EDVAC.
OPERATIONS
An ALU must process numbers using the same formats as the
rest of the digital circuit. The format of modern processors is
almost always the two's complement binary number
representation.
The ones' complement and two's complement number systems
allow for subtraction to be accomplished by adding the
negative of a number in a very simple way which negates the
need for specialized circuits to do subtraction; however,
calculating the negative in two's complement requires adding a
one to the low order bit and propagating the carry. An
alternative way to do two's complement subtraction of AB is
to present a one to the carry input of the adder and use B
rather than B as the second input. The arithmetic, logic and
shift circuits introduced in previous sections can be combined
into one ALU with common selection.
BASIC FUNCTIONS PERFORMED BY AN ALU
OPERATION
TYPE
Arithmetic
Arithmetic
Arithmetic
Arithmetic
Logic
Logic
Logic
Logic
OPERATION
FUNCTION
A+B
A-B
A+1
A-1
AB
AB
AB
A
Addition
Subtraction
Increment A
Decrement A
AND operation
OR operation
XOR operation
Complement A
expensive the ALU is, the more space it uses in the processor,
and the more power it dissipates. Therefore, engineers
compromise. They make the ALU powerful enough to make the
processor fast, yet not so complex as to become prohibitive.
The options vary from the fastest and most expensive one to
the slowest and least expensive one. Therefore, while even the
simplest computer can calculate the most complicated formula,
the simplest computers will usually take a long time doing that
because of the several steps for calculating the formula.
.
VHDL
VHDL (Very High Speed Integrated Circuit Hardware Description
Language) is a hardware description language used in
electronic design to describe digital and mixed-signal systems
such as field-programmable gate arrays and integrated circuits.
VHDL has file input and output capabilities, and can be used
as a general-purpose language for text processing, but files
are more commonly used by a simulation testbench for
stimulus or verification data.
When a VHDL model is translated into the "gates and wires"
that are mapped onto a programmable logic device such as a
CPLD or FPGA, then it is the actual hardware being
configured, rather than the VHDL code being "executed" as if
on some form of a processor chip.
VHDL SIMULATORS
Aldec Active-HDL
Cadence Incisive (Past products: NC-VHDL)
Mentor Graphics ModelSim. Special versions of this
product used by various FPGA vendors e.g. Altera, Lattice
Synopsys VCS-MX
Xilinx Vivado (a.k.a. xsim). Based on iSim from the
previous ISE tool-chain
ADVANTAGES OF VHDL
CODE
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;
use IEEE.STD_LOGIC_unsigned.ALL;
entity alu4 is
Port ( a : in STD_LOGIC;
b : in STD_LOGIC;
cin : in STD_LOGIC;
z : out STD_LOGIC;
cout : out STD_LOGIC;
s1 : in STD_LOGIC;
s2 : in STD_LOGIC;
s3 : in STD_LOGIC);
end alu4;
6
z<= a xor b;
elsif ( s1 = '1' and s2 = '1' and s3 = '0' ) then
z<= not a ;
elsif ( s1 = '1' and s2 = '1' and s3 = '1' ) then
z<= a xor '1';
cout <= a;
end if;
end process;
end Behavioral;