Penerbit 006
Penerbit 006
2 (2020) 46-54
*Corresponding Author
DOI: https://doi.org/10.30880/jeva.2020.01.02.006
Received 01 October 2020; Accepted 21 December 2020; Available online 28 December 2020
Abstract: Arithmetic Logic Unit (ALU) is one of the most crucial components of an embedded system and has
been used in many devices such as cell phones, calculator, computers, and many other applications. It performs all
the arithmetic and logical operations such as addition, subtraction, logical AND and OR. An ALU is a multi-
functional circuit that conditionally performs one of several possible functions of two operands A and B depending
on control inputs. It is nevertheless the main performer of any computing device. The objective of this project is to
design ALU 16-bit using VHDL. The Altera Quartus II software is used as the tool to create the designed operation
of multiplication and division. The simulation results show that the proposed ALU design successfully perform the
operation of multiplication and division of 16 bits operation.
1. Introduction
In computing, an arithmetic and logic unit (ALU) is a digital circuit that performs integer arithmetic and logical
operations [1]. The Arithmetic Logic Unit (ALU) is a basic block of the central processing unit of a computer, and even
the simplest microprocessors that performs the work of maintaining the timers. The processors accommodate very
powerful and very complex ALUs inside modern Central Processing Unit (CPUs) and Graphics Processing Units
(GPUs), as the single component that may contain a few ALUs [2].
Fig. 1 is an ALU that has two inputs called operands, and a code which is call as OPCODE. The specified code
will operatize performed on the operands. ALU also has a result output which is the result of the operation on the
operands [3].
Arithmetic shifts can be useful as efficient ways of performing multiplication or division of signed integers by
powers of two. In multiplying 2n, shifting left by n bits on signed binary number or unsigned binary number will affect
the output. While, in dividing it by 2n, this requires to shifting left by n bits on signed binary number or unsigned
binary number [4].
In performing division and multiplication of integers by power of two, logical shift is used. The process is in
shifting left by k bits on a binary number is equivalent to multiplying it by 2k. The same goes to shifting right by k bits
on a binary number is equivalent to dividing it by 2k. For example, consider the binary number is 0001 0111 [2][5].
For multiplication, it is an algorithm where N bit is multiplicand by N bit multiplier. In ALU 16 bit, a multiplier
can multiply an 8-bit number with another 8-bit number, and this will result in a 16-bit product. Here, the column
bypass technique is used where this will reduce power consumption. In calculating each bit in a product, the
compressor module is used in which this will help reduce the power. There are two methods to obtain power reduction
which are column bypass or compressor.
47
M. I. M. Taib et al., Journal of Electronic Voltage and Application Vol. 1 No. 2 (2020) p. 46-54
16 bits Operation
0000 A X 000
0001 A X 001
0010 A X 010
0011 A X 011
Multiplication
0100 A X 100
0101 A X 101
0110 A X 110
0111 A X 111
1000 A ÷ 000
1001 A ÷ 001
1010 A ÷ 010
1011 A ÷ 011
Division
1100 A ÷ 100
1101 A ÷ 101
1110 A ÷ 110
1111 A ÷ 111
48
M. I. M. Taib et al., Journal of Electronic Voltage and Application Vol. 1 No. 2 (2020) p. 46-54
module muldiv_calculator(
input [7:0] A, // ALU 8-bit Inputs
input [3:0] ALU_Sel,// ALU Selection
output [7:0] ALU_Out, // ALU 8-bit Output
output CarryOut // Carry Out Flag
);
reg [7:0] ALU_Result;
wire [8:0] tmp;
assign ALU_Out = ALU_Result; // ALU out
assign CarryOut = tmp[8]; // Carryout flag
always @(*)
begin
case(ALU_Sel)
//Multiplication operation
4'b0000: // multiply 0
ALU_Result = A*3'b000 ;
4'b0001: // multiply 1
ALU_Result = A*3'b001 ;
4'b0010: // multiply 2
ALU_Result = A*3'b010;
4'b0011: // multiply 3
ALU_Result = A*3'b011;
4'b0100: // multiply 4
ALU_Result = A*3'b100;
4'b0101: // multiply 5
ALU_Result = A*3'b101;
4'b0110: // multiply 6
ALU_Result = A*3'b110;
4'b0111: // multiply 7
ALU_Result = A*3'b111;
//Division operation
4'b1000: // divide 0
ALU_Result = A/3'b000;
4'b1001: // divide 1
ALU_Result = A/3'b001;
4'b1010: // divide 2
ALU_Result = A/3'b010;
4'b1011: // divide 3
ALU_Result = A/3'b011;
4'b1100: // divide 4
ALU_Result = A/3'b100;
4'b1101: // divide 5
ALU_Result = A/3'b101;
4'b1110: // divide 6
ALU_Result = A/3'b110;
4'b1111: // divide 7
ALU_Result = A/3'b111;
default: ALU_Result = 8'b00000000;
endcase
end
endmodule
49
M. I. M. Taib et al., Journal of Electronic Voltage and Application Vol. 1 No. 2 (2020) p. 46-54
50
M. I. M. Taib et al., Journal of Electronic Voltage and Application Vol. 1 No. 2 (2020) p. 46-54
Fig. 6 - Add and Div. has been used to perform the input value
51
M. I. M. Taib et al., Journal of Electronic Voltage and Application Vol. 1 No. 2 (2020) p. 46-54
3. Result of Experiment
3.1 Timing Diagram of Multiplication operation
Fig. 8 shows the simulation result of binary number when the input is 1011 and the operation ALU-16 bit that is
chosen is 0001. The result is 1011 in binary.
Fig. 9 shows the simulation result of binary number when the input is 11011 and the operation ALU-16 bit that is
chosen is 0100. The result is 1101100 in binary.
Fig. 10 shows the simulation result of binary number when the input is 1011011 and the operation ALU-16 bit that
is chosen is 0110. The result is 1000100010 in binary.
All the results shown using simulation in Quartus II are same as the calculation made in Microsoft Excel as in
Table 2. Table 2 shows the result obtain for multiplication operation with the input of A and multiplication with the
output which is ALU results.
52
M. I. M. Taib et al., Journal of Electronic Voltage and Application Vol. 1 No. 2 (2020) p. 46-54
1011 1 1011
11011 100 1101100
1011011 110 1000100010
Fig. 12 shows the simulation result of binary number when the input is 1010 and the operation ALU-16 bit that
been chosen is 1110. The result is 0001 in binary.
Fig. 13 shows the simulation result of binary number when the input is 111011 and the operation ALU-16 bit that
been chosen is 1010. The result is 11101 in binary.
All the results shown using simulation in Quartus II are the same as the calculation made in Microsoft Excel as
illustrated in Table 3.
53
M. I. M. Taib et al., Journal of Electronic Voltage and Application Vol. 1 No. 2 (2020) p. 46-54
Operation
A ALU Result
(Division)
11110 10 1111
1010 110 1
111011 10 11101
4. Conclusion
To sum up, Arithmetic Logic Unit (ALU) perform an arithmetic and logical operation where this project uses
division and multiplication. Arithmetic Logic Unit (ALU) 16-Bit Division and Multiplication can be designed using
Altera Quartus II software. Operation of division and multiplication is a kind of calculator that can calculate for both
input and output of 16-bit operation. Using Altera Quartus II software code can be create based on the project objective.
Simulation results prove that this design was successfully performed as expected.
Acknowledgement
This work was partially supported by the Faculty of Electrical and Electronic Engineering (FKEE), and Research
Management Center (RMC), Universiti Tun Hussein Onn Malaysia.
References
[1] Zandbergen, P. (2015). Arithmetic Logic Unit (ALU): Definition, Design & Function. Lessons and Online
Courses, Available:https://study.com/academy/lesson/arithmetic-logic-unit-alu-definition-design function.html
[2] Bharath, R. M. (2016). Design, Analysis, and Synthesis of a 16 bit Arithmetic Logic Unit using Reversible Logic
Gates.Available:http://search.proquest.com/openview/09e15f3998b446b987d6e42859e3dc45/1?pqorigsite=gschola
r&cbl=18750&diss=y
[3] IAY0340 Labs. (2020). Arithmetic Logic Unit (ALU).
Available: http://ati.ttu.ee/IAY0340/labs/Tutorials/SystemC/ALU.html
[4] Thapliyal, H. Srinivas, M.B (2005). Novel design and reversible logic synthesis of multiplexer based full adder and
multipliers. 48th Midwest Symposium on Circuits and Systems, 1593-1596
[5] Rakhi, N. Neeraj, K.S. (2018). Resource Utilization Optimization with Design Alternatives in FPGA based
Arithmetic Logic Unit Architectures. Procedia Computer Science, 132, 843-848
54