Introductory Digital Electronics -Tutorial 2 with a Quiz at the end: Number System - Binary Addition, Binary Subtraction, Booth Multiplication


Number System

 



                                                                                                                    --------------xxxxx--------------



                                                        Digital Electronics Tutorial II: More on the Number System

Number System

 

An outline of what this tutorial contains


Here's a quick look at the topics which will be covered in this tutorial 

BINARY ADDITION


There are four basic rules for binary addition--
0+0= 0
0+1 = 1
1 +0= 1
1 + 1 = 10

Let's add two binary numbers say- 10011 and 01000. Binary addition is also carried out the same way as you normally add two numbers

10011
01000
--------
11011

BINARY SUBTRACTION


Basic Rules for binary subtraction are-

0-0=0
1-0 =1
1-1 =1
10-1 = 1

How will you subtract 01001 from 11011 ?


BINARY MULTIPLICATION


Multiplication is done by repeatedly adding one number by number of times equal to the second number. eg. 8x4=8+8+8+8

For binary multiplication also, we do the same thing. eg 0101 x 0011
The decimal equivalent of 0011 is 3. So to find the product, we can add 0101 to itself 3 times

0101
+ 0101

1010
+ 0101
1111

So, the product of 0101 and 0011 is 1111. We can check our result by looking at the decimal equivalents of these numbers.

0101 ---> 5
0011 ---> 3
1111 ---> 15


BOOTH'S MULTIPLICATION ALGORITHM


Consider that we have to find the product 'm x r'.
Here 'm' is called 'multiplicand' and 'r' is called 'multiplier'.
Let, number of bits in 'm' is 'x' and number of bits in 'r' is 'y'.


The Algorithm :


1. Define 3 values namely A, S, and P of length 'x+y+1' as-
A: fill left-most bits with value of 'm' and rest bits with '0'.
S: fill left-most bits with value of '-m' and rest bits with '0'.
P: fill left-most 'x' bits with '0', then 'y' bits with value of 'r'
and right-most bit with value '0'.

2. Determine two right-most bits of P
i) If they are 01, then add A to P
ii) If they are 10, then add S to P
iii) If they are 00 or 11, then jump to next step.

3. Shift the value of P to right by a single bit.

4. Repeat steps 2 and 3 'y' times
5. Drop right-most bit from P, leftover is the required product.

The tutorial explains this with the help of an example.

Apart from this, the tutorial also introduces the concepts of Signed and Unsigned numbers.


Complete Tutorial Document with Examples (Scroll down this page if you'd like to take the Quiz) :



MCQ Quiz


Companion MCQ Quiz for Number Systems- test how much you know about the topic. Your score will be e-mailed to you at the address you provide.

Google Spreadsheet Form


Here's a list of all the tutorials we currently have in this area - Introductory Digital Electronic Circuits and Boolean logic

 Introduction to the Number System : Part 1 
Introducing number systems. Representation of numbers in Decimal, Binary,Octal and Hexadecimal forms. Conversion from one form to the other.
 Number System : Part 2 
Binary addition, subtraction and multiplication. Booth's multiplication algorithm. Unsigned and signed numbers. 
Introduction to Boolean Algebra : Part 1
 Binary logic: True and false. Logical operators like OR, NOT, AND. Constructing truth tables. Basic postulates of Boolean Algebra. Logical addition, multiplication and complement rules. Principles of duality.  Basic theorems of boolean algebra: idempotence, involution, complementary, commutative, associative, distributive and absorption laws. 
Boolean Algebra : Part 2
De-morgan's laws. Logic gates. 2 input and 3 input gates. XOR, XNOR gates. Universality of NAND and NOR gates. Realization of Boolean expressions using NAND and NOR. Replacing gates in a boolean circuit with NAND and NOR.
  Understanding Karnaugh Maps : Part 1 Introducing Karnaugh Maps. Min-terms and Max-terms. Canonical expressions. Sum of products and product of sums forms. Shorthand notations. Expanding expressions in SOP and POS Forms ( Sum of products and Product of sums ). Minimizing boolean expressions via Algebraic methods or map based reduction techniques. Pair, quad and octet in the context of Karnaugh Maps.

Karnaugh Maps : Part 2
Map rolling. Overlapping and redundant groups. Examples of reducing expressions via K-Map techniques.
 Introduction to Combinational Circuits : Part 1
Combinational circuits: for which logic is entirely dependent of inputs and nothing else. Introduction to Multiplexers, De-multiplexers, encoders and decoders.Memories: RAM and ROM.  Different kinds of ROM - Masked ROM, programmable ROM. 
 Combinational Circuits : Part 2
 Static and Dynamic RAM, Memory organization.
Introduction to Sequential Circuits : Part 1 
Introduction to Sequential circuits. Different kinds of Flip Flops. RS, D, T, JK. Structure of flip flops. Switching example. Counters and Timers. Ripple and Synchronous Counters. 
Sequential Circuits : Part 2
ADC or DAC Converters and conversion processes. Flash Converters, ramp generators. Successive approximation and quantization errors. 
 


 




Comments