Skip to main content

ARITHMETIC OPERATIONS ON BINARY NUMBER

Binary arithmetic is simpler to learn because binary number system deals with only two digits - 0 and 1. Binary number perform all arithmetic operation such as Addition, Substraction, Multiplication and compliment as in decimal number system.
Binary Addition
The addition table for binary arithmetic consist of only the following four entries:
0+0=0
0+1=1
1+0=1
1+1=0 , plus a carry of 1 to the next column.
    1011       
+ 1100
   10111

   1100
   +1100
    11000

Binary Substraction
There are three ways to do substraction between binary numbers:-
1. Simple Substraction
2. Substraction using 1's Complement
3. Substraction using 2's Complement
Simple Substraction: The complete table of binary substraction is as follows:
0-0=0
0-1=1, borrow 1 from next column
1-0=1
1-1=0
   1101
- 0101
  1000 

   1001
 - 0111
   0010
Substraction using 1'st Complement
We can do substraction using 1's complement. the steps are gi ven below:-
1. First we have to change the 2nd number(which is to substract) into 1's complement.
2. Here 1's complement mean exchanging the digit value mean convert '1' into '0' and '0' into '1' .
3. and perform addition operation on first number and the converted 1's complement number.
4. if we get an extra bit then ignore the extra bit and add 1 in the get result (after addition) to get final result.
5. If we can't get an extra bit then we again do 1's complement  to get final result.

Comments

Popular posts from this blog

Computer Generations

 Computer Generations   Computers have evolved over time through different generations, each marked by significant technological advancements and changes in design and architecture. These generations are often categorized based on the underlying hardware and the key developments that distinguish one Generation from another. Let's explore the main computer generations: First Generation Computers    The First Generation of computers refers to the initial period of electronic computing, characterized by the use of vacuum tubes as the primary electronic component. This Generation spans the 1940s and 1950s and is marked by groundbreaking developments in computer technology.  Examples of First-Generation Computers:  o ENIAC (Electronic Numerical Integrator and Computer): Completed in 1945, ENIAC was one of the first electronic general-purpose computers. It was designed to calculate artillery firing tables for the United States Army during World War ...

Programming in "C"

 Introduction   C is a general-purpose programming language that was developed in the early 1970s by Dennis Ritchie at Bell Laboratories. It has since become one of the most widely used programming languages and has influenced the development of many other languages, including C++, Java, and C#. C is known for its efficiency, flexibility, and low-level programming capabilities. It is commonly used for system programming, embedded systems, and developing operating systems. C is also a popular choice for developing applications that require high performance, such as game engines and scientific simulations.   Here are some key features and concepts of C programming:   Syntax: C has a relatively simple syntax compared to some other programming languages. It uses a combination of keywords, variables, data types, operators, and control structures to write programs.  Variables and Data Types: You declare variables to store data in C. Various d...

History of Language "C"

  History of C      The history of C programming dates back to the early 1970s when Dennis Ritchie created it at Bell Laboratories. Here's a brief timeline of the major milestones in the history of C:  1969: The development of C began as a successor to the B programming language, which Ken Thompson created. Dennis Ritchie wanted to improve upon B's capabilities and efficiency.  1972: The C programming language was developed primarily to support the development of the Unix operating system. Ken Thompson and Dennis Ritchie rewrote Unix in C, which helped in porting the operating system to different computer architectures easily. 1978: The first edition of "The C Programming Language," also known as the "K&R C," was published. Brian Kernighan and Dennis Ritchie wrote it, becoming the authoritative reference for C programming. 1983: The American National Standards Institute (ANSI) formed a committee to establish a standard for the C language. The ...