Professional Documents
Culture Documents
Reportvish Merged Removed Removed
Reportvish Merged Removed Removed
Reference: ................................................................................................................................................... 25
Abstract:
This project explores the creation and utilization of an Arithmetic Logic Unit (ALU) within the framework
of an 8086 Emulator. By thoroughly understanding the architecture of the 8086, identifying ALU
operations, and meticulously implementing control logic within the emulator environment, this
endeavor addresses challenges posed by the emulator's limited instruction set and the need for
emulation accuracy. Its significance lies in its educational value, providing practical insights into historic
architectures and fundamental principles of computer science. By surmounting the constraints of the
8086 Emulator, this project lays the groundwork for future developments in ALU design and
collaborative research endeavors. Its ultimate goal is to enhance comprehension of ALU functionality
and enrich the broader field of computer science and engineering.
Introduction:
The Arithmetic Logic Unit (ALU) is a fundamental component of a computer's central processing unit
(CPU) responsible for performing arithmetic and logic operations. The 8086 emulator is a software tool
that emulates the functionality of the 8086 microprocessor, providing a platform for understanding and
experimenting with ALU design principles in a simulated environment.
This report aims to provide a comprehensive examination of ALU design using the 8086 emulator. It will
delve into the fundamental principles of ALU design, the functionality of the 8086 emulator, and the
interconnection between the two.
EMULATOR
The 8086 Emulator stands as a virtual environment crafted to replicate the intricate workings of
the Intel 8086 microprocessor, offering users the ability to execute software designed for this
architecture on contemporary computing systems. Key features of the 8086 Emulator encompass a
spectrum of essential functionalities:
This emulation platform serves as a vital tool for software developers and enthusiasts alike,
facilitating exploration, experimentation, and analysis within the realm of legacy computing
architectures.
Block Diagram of Arithmetic Logic Unit:
Methodology
The basic methodology for designing an ALU using an 8086 Emulator involves following steps:
•Understanding 8086 Architecture: The familiarization with the architecture of 8086 microprocessor
helps in understanding how the CPU operates that will provide assistance to design ALU that integrates
seamlessly with processor.
•Identify ALU Operations: Determine the arithmetic and logical operations that the ALU needs to
support based on the requirements of your application.
•Design ALU Control Logic: Define the control logic for selecting and executing the appropriate
operation based on instruction opcode and operands which involves designing a Finite State Machine
•Implement ALU Operations: Write Code to implement each ALU operation using Assembly Language
Programming. For each operation, you will need to handle different operand types and produce correct
result based on the operation code.
•Test and Debug: Test each ALU operation thoroughly to ensure accuracy and debug any issues
encountered during testing to refine the ALU Implementation.
•Integrate with Emulator: Integrate ALU implementation into 8086 Emulator environment, ensuring
compatibility
with emulator’s memory layout, instruction execution flow, and register usage
org 100h
msg_intro db ' 1. Addition', 0dh,0ah, ' 2. Subtration', 0dh,0ah, ' 3. Multiplication', 0dh,0ah, ' 4. Division',
0dh,0ah, ' 5. Negation', 0dh,0ah, ' 6. OR', 0dh,0ah, ' 7. AND ', 0dh,0ah, ' 8. XOR', 0dh,0ah, ' 9.
NOT',0dh,0ah, ' 10. Modulus',0dh,0ah, ' 0. EXIT', '$'
num1 dw ? ;Uninitialize
num2 dw ? ;Uninitialize
res dw ?
agn dw ?
MAIN PROC
MOV DS, AX
Start: ;Start Lable
printn
MOV AH,9
INT 21h
printn
printn
CALL scan_num
printn
printn
CMP CX, 0
CMP CX, 1
CMP CX, 2
CMP CX, 3
CMP CX, 4
CMP CX, 5
CMP CX, 6
CMP CX, 7
CMP CX, 8
JE _XOR ;Jumps to _NOT Func if input is equal to 8
CMP CX, 9
CMP CX, 10
;FUNCTIONS
printn
printn
printn
printn
MOV AH,9
printn
printn
printn
printn
MOV AH,9
printn
printn
printn
printn
MOV AH,9
printn
printn
printn
JE Error ;overflow
printn
MOV AH,9
printn
printn
printn
MOV AH,9
Modulus:
print ' --Modulus--'
printn
printn
printn
printn
MOV AH,9
printn
printn
printn
OR AX, num2
MOV res, AX
printn
MOV AH,9
JMP Con
printn
printn
printn
MOV res, AX
printn
MOV AH,9
JMP Con
printn
printn
printn
MOV res, AX
printn
MOV AH,9
JMP Con
_NOT: ;NOT Func
printn
printn
NOT AX
MOV res, AX
printn
MOV AH,9
CALL print_num
JMP Con
Error:
printn
printn
printn
printn
JMP Division
printn
MOV AH,9
MOV DX, OFFSET cont ;Displaying Message
MOV agn, CX
printn
printn
CMP agn, 1
CMP agn, 0
printn
printn
printn
MOV AH,9
INT 21h
MAIN ENDP
DEFINE_SCAN_NUM
DEFINE_PRINT_NUM
DEFINE_PRINT_NUM_UNS
END main
HLT ;Halting
ret ;Return
Results:
1. Addition:
2. Subtraction:
3. Multiplication:
4. Division:
5. OR 6. AND
7. TRAFFIC LIGHT
DISCUSSION:
The 8086 microprocessor represents a legacy architecture characterized by its distinctive
features and limitations. Crafting an ALU within the confines of this architecture demands a
profound understanding of its complexities. It entails navigating segmented memory, a
constrained instruction set, and diverse addressing modes, presenting both challenges and
intellectual opportunities.
While the 8086 Emulator serves as a valuable platform for ALU development and testing, it also
opens avenues for the incorporation of contemporary tools and methodologies. Leveraging
high-level programming languages for prototyping and testing can expedite the development
process.
Furthermore, it is essential to consider the compatibility and adaptability of the ALU design
across various 8086 emulator implementations. Although the fundamental architecture of the
8086 remains standardized, individual emulators may exhibit slight discrepancies in behaviour
or feature support. Designing the ALU with compatibility in mind ensures seamless integration
into diverse emulator environments, minimizing the need for extensive modifications.
LIMITATIONS:
• Restricted Instruction Set and Segmented Memory Model: The constrained instruction set imposes
limitations on the variety of operations the ALU can perform, often necessitating optimization efforts to
achieve desired functionality. Additionally, the segmented memory model introduces complexities in
memory access, adding overhead and hindering the efficiency of memory-intensive ALU operations.
• Resource Scarcity: Within the 8086 architecture, scarcity of resources such as registers, memory, and
processing capabilities presents significant challenges to ALU design and implementation.
• Emulation Fidelity: While 8086 Emulators endeavor to faithfully replicate the behavior of the original
hardware, discrepancies or limitations in emulation accuracy may arise, impacting the reliability of ALU
operations.
• Performance Bottlenecks: Overhead associated with emulation, latency in memory access, and other
performance constraints can impede the speed and efficiency of ALU operations, constraining the
scalability of the design.
FUTURE SCOPE:
• While the 8086 architecture is characterized by a limited instruction set, future advancements may
entail expanding the instruction set to accommodate additional operations and functionalities.
• Exploring hardware acceleration methods and coprocessing architectures can significantly enhance the
performance and efficiency of the ALU design. Integration of the ALU with specialized hardware
accelerators, such as FPGA-based coprocessors or GPU accelerators, has the potential to optimize
compute-intensive tasks and enhance overall system performance.
• Implementing parallelism and vectorization techniques within the emulator environment can enable
the ALU to process multiple data elements concurrently, resulting in substantial speed improvements
for computation-intensive operations.
• The ALU design developed within the 8086 Emulator framework serves as a robust foundation for
further exploration and experimentation in computer architecture, digital logic design, and
microprocessor systems research.
CONCLUSION:
In conclusion, crafting an Arithmetic Logic Unit (ALU) within the framework of an 8086 emulator
presents both challenges and rewards, offering profound insights into computer architecture, digital
logic design, and microprocessor systems. This endeavor empowers developers with hands-on
experience, immersing them in legacy architectures and reinforcing fundamental computing concepts.
Despite the 8086's classification as outdated, the enduring principles and concepts inherent in its design
retain relevance in contemporary computing landscapes. Creating an ALU under the constraints of the
8086 emulator environment cultivates creativity, sharpens problem-solving skills, and nurtures critical
thinking abilities applicable to a broad spectrum of computational tasks.
References
• https://github.com/sasaber/alu- assembly/blob/master/CS47_proj_alu_logical.asm
• https://github.com/ibrahimansari/MIPS-ALU- Implementation
• https://github.com/Haseeeb21/Calculator- Assembly/blob/main/Calculator.asm
• https://github.com/yousefkotp/8086-Assembly-Projects
• https://github.com/Mati365/ts-c-compiler