0% found this document useful (0 votes)
9 views6 pages

Assignment Activity Unit 4

Uploaded by

Tornado Fair
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
0% found this document useful (0 votes)
9 views6 pages

Assignment Activity Unit 4

Uploaded by

Tornado Fair
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 6

1.

CS 1105-01 - AY2024-T5
2. Assignment Activity Unit 4

Assignment Activity Unit 4


Completion requirements
To do: Make a submission

Opened: Thursday, 11 July 2024, 12:05 AM


Due: Thursday, 18 July 2024, 11:55 PM

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.

In this assignment you will design a digital calculator showcasing binary


arithmetic, implementing binary adder, subtractor, multiplier, and divider
modules. Highlight benefits of binary computation while integrating these
modules into a CPU for seamless operations, promoting understanding of
number systems.

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.

Here's a high-level overview of how each operation can be implemented:

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 subtraction can be implemented using the concept of 2's complement.


Convert the number to be subtracted into its 2's complement form.
Add the 2's complement to the original number using binary addition.
Example: 1011 (11 in decimal) - 0101 (5 in decimal) = 0110 (6 in decimal)
Binary Multiplication:

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:

Binary division is similar to decimal division.


Start with the dividend and divisor in binary form.
Subtract the divisor from the dividend if it fits, and set the corresponding quotient bit to 1.
Move to the next bit in the dividend and continue the subtraction process.
Example: 1011 (11 in decimal) / 0101 (5 in decimal) = 10 (2 in decimal)

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.

1. To ensure seamless mathematical operations, the binary adder,


subtractor, multiplier, and divider modules should be properly
integrated and organized. This can be done by designing a control unit
that coordinates the operation of these modules and provides
necessary input/output interfaces.

 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.

1. Here are some examples of binary calculations using the designed


modules:

 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)

1. The advantages of using binary arithmetic compared to decimal


arithmetic include:

 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.

The challenges of using binary arithmetic compared to decimal arithmetic


include:

 Increased number length: Binary numbers are typically longer than


their decimal equivalents, which can make calculations more complex
and memory requirements higher.
 Lack of human readability: Binary numbers can be more difficult for
humans to read and interpret compared to decimal numbers.

1. Designing such a calculator that incorporates binary arithmetic


promotes a deeper understanding of number systems and
mathematical operations by:

 Highlighting the fundamental role of binary arithmetic in computer


systems.
 Providing an opportunity to work directly with binary numbers and
operations, enhancing understanding of binary representations and
manipulations.
 Showcasing the practical applications of binary arithmetic in digital
calculators and CPUs, reinforcing the relevance of number systems in
computing.

You might also like