Assignment Activity Unit 4
Assignment Activity Unit 4
CS 1105-01 - AY2024-T5
2. Assignment Activity Unit 4
Assignment Instructions:
This assignment will not only offer you practical benefits but also foster a deeper
understanding of number systems and mathematical operations, equipping you
with valuable skills for various fields in computer science and engineering.
Scenario:
Imagine you are part of a team working on designing a new digital calculator for
a mathematics competition. Your task is to implement various arithmetic
operations on binary numbers, including addition, subtraction, multiplication,
and division. This calculator aims to showcase the efficiency and versatility of
binary arithmetic in solving mathematical problems.
Assignment:
1. Compose a detailed explanation of how you would design and develop the
binary adder, subtractor, multiplier, and divider modules for the calculator.
2. Illustrate how you would integrate and organize these modules to ensure
seamless mathematical operations.
3. Provide detailed examples of binary calculations for each operation to
demonstrate the functionality of your design.
4. Summarize the advantages and challenges of using binary arithmetic in
comparison to decimal arithmetic.
5. Highlight the significance of designing such a calculator in promoting a
deeper understanding of number systems and mathematical operations.
Binary arithmetic is an important concept in computer science and is used extensively in digital
calculators and CPUs. Designing a digital calculator that uses binary arithmetic operations like
addition, subtraction, multiplication, and division would involve implementing these operations
in binary format.
Binary Addition:
Binary addition involves adding two binary numbers together, bit by bit.
Start from the rightmost bit and perform binary addition for each pair of bits.
Carry the carry-over to the next bit if the result is greater than 1.
Continue this process until all bits have been added.
Example: 1011 (11 in decimal) + 0101 (5 in decimal) = 10000 (16 in decimal)
Binary Subtraction:
Binary multiplication is similar to decimal multiplication, but only involves two possible digits:
0 and 1.
Multiply the multiplicand with each bit of the multiplier.
Shift the partial products to the left based on the position of the multiplier bit.
Add all the shifted partial products to get the final result.
Example: 1011 (11 in decimal) * 0101 (5 in decimal) = 1100011 (99 in decimal)
Binary Division:
1. Integrating these binary arithmetic operations into a CPU would provide smooth
operations and enhance understanding of number systems because binary is the
fundamental language of computers. CPUs are designed with circuits that can perform
these operations efficiently, allowing for fast calculations and precise results. By
understanding binary arithmetic and how it is implemented in a calculator or CPU, we
can better grasp the inner workings of computers and how they process numbers.
Designing and developing the binary adder, subtractor, multiplier, and divider
modules for the calculator would involve creating circuits or algorithms that
perform the respective operations. Here are some high-level steps for each
module:
Binary Adder:
o Implement a circuit or algorithm that performs binary addition bit by bit.
o Start from the rightmost bits and perform addition for each pair of bits, with
consideration for carry-overs.
o Repeat the process until all bits have been added.
Binary Subtractor:
o Use the concept of 2's complement to convert the number to be
subtracted into its negative form.
o Add the negative number to the original number using the binary adder
module.
o Discard the overflow bit and the leading 1 if present.
Binary Multiplier:
o Implement a circuit or algorithm that performs binary multiplication by
iteratively multiplying the multiplicand with each bit of the multiplier.
o Start with the rightmost bit of the multiplier and shift the partial product to
the left based on the position of the multiplier bit.
o Accumulate all the shifted partial products to get the final result.
Binary Divider:
o Implement a circuit or algorithm that performs binary division by iteratively
subtracting the divisor from the dividend.
o Start with the leftmost bit of the dividend and continue the subtraction
process until all bits have been processed.
o Set the quotient bit to 1 if the subtraction is successful and move to the
next bit.
The control unit should be able to receive input numbers, select the
appropriate operation, and control the flow of data between the
modules.
Based on the selected operation, the control unit should activate the
corresponding module(s) and pass the input numbers to them.
The result obtained from the module(s) should be fed back to the
control unit, which then outputs the final result.
Binary Addition:
o 1011 (11 in decimal) + 0101 (5 in decimal) = 10000 (16 in
decimal)
Binary Subtraction:
o 1011 (11 in decimal) - 0101 (5 in decimal) = 0110 (6 in decimal)
Binary Multiplication:
o 1011 (11 in decimal) * 0101 (5 in decimal) = 1100011 (99 in
decimal)
Binary Division:
o 1011 (11 in decimal) / 0101 (5 in decimal) = 10 (2 in decimal)
Simplicity: Binary arithmetic deals with only two possible digits (0 and
1), making calculations and circuit implementations relatively
straightforward.
Compatibility: Binary arithmetic aligns well with the underlying digital
nature of modern computing systems.
Efficiency: Binary arithmetic operations can be performed using simple
logic gates, which can be implemented in hardware or executed
quickly in software.