Download Example - E

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Elementary arithmetic wikipedia , lookup

Arithmetic wikipedia , lookup

Addition wikipedia , lookup

Approximations of π wikipedia , lookup

Elementary mathematics wikipedia , lookup

Location arithmetic wikipedia , lookup

Positional notation wikipedia , lookup

Transcript
-1CORE 2 : DIGITAL FUNDAMENTALS AND ARCHITECTURE
Subject Description: This subject deals with fundamentals of digital computers,
Microprocessors and System architecture. Goal: To learn about Computer Fundamentals
and its Architecture. Objective: On successful completion of this subject the students
should have Knowledge on Digital circuits, Microprocessor architecture, and Interfacing
of various components.
UNIT-I: Number System and Binary Codes: Decimal, Binary, Octal, Hexadecimal –
Binary addition, Multiplication, Division – Floating point representation, Complements,
BCD, Excess3, Gray Code. Arithmetic Circuits: Half adder, Full adder, Parallel binary
adder, BCD adder, Half subtractor, Full subtractor, Parallel binary subtractor - Digital
Logic: the Basic Gates – NOR, NAND, XOR Gates.
UNIT-II: Combinational Logic Circuits: Boolean algebra – Karnaugh map – Canonical
form 1 – Construction and properties – Implicants – Don’t care combinations - Product of
sum, Sum of products, simplifications. Sequential circuits: Flip-Flops: RS, D, JK, and T Multiplexers – Demultiplexers – Decoder Encoder – shift registers-Counters.
UNIT-III: Input – Output Organization: Input – output interface – I/O Bus and Interface
– I/O Bus Versus Memory Bus – Isolated Versus Memory – Mapped I/O – Example of
I/O Interface. Asynchronous data transfer: Strobe Control and Handshaking – Priority
Interrupt: Daisy- Chaining Priority, Parallel Priority Interrupt. Direct Memory Access:
DMA Controller, DMA Transfer. Input – Output Processor: CPU-IOP Communication.
UNIT-IV: Memory Organization: Memory Hierarchy – Main Memory- Associative
memory: Hardware Organization, Match Logic, Read Operation, Write Operation. Cache
Memory: Associative, Direct, Set-associative Mapping – Writing into Cache
Initialization. Virtual Memory: Address Space and Memory Space, Address Mapping
Using Pages, Associative Memory, Page Table, Page Replacement.
UNIT-V: CASE STUDY: Pin out diagram, Architecture, Organization and addressing
modes of 80286-80386-80486-Introduction to microcontrollers.
TEXT BOOKS: 1. Digital principles and applications, Albert Paul Malvino, Donald P
Leach , TMH,1996. 2.COMPUTER SYSTEM ARCHITECTURE -M. Morris Mano ,
PHI. 3. MICROPROCESSORS AND ITS APPLICATIONS-RAMESH S.GOANKAR
REFERENCE BOOKS: 1. DIGITAL ELECTRONICS CIRCUITS AND SYSTEMS V.K. Puri , TMH. 2. COMPUTER ARCHITECTURE , M. Carter , Schaum’s outline
series, TMH.
-1-
-2SUBJECT: DIGITAL ELECTRONICS AND COMPUTER FUNDAMENTALS
CLASS : I B.Sc
SEMESTER: II
UNIT : 1
STAFF: S.FAIZAL RAHMAN
TOPICS COVERED:
REPRESENTATION OF INFORMATION: NUMBER SYSTEM AND CODES –
BINARY TO DECIMAL CONVERSION – DECIMAL TO BINARY CONVERSION –
OCTAL NUMBERS – HEXADECIMAL NUMBERS – ASCII CODE – EXCESS- 3 CODE
– GRAY CODE.
1. REPRESENTATION OF INFORMATION:
Modern computers do not process decimal numbers. Instead they work
with binary numbers which use only the digits 0 and 1. Why binary numbers?
Because electronic devices are most reliable when designed for two-state
(binary) operation.
Some basic features which are common to all digital processing of
information which enables us to treat the subject in a unified manner.
These are:
I. All streams of input symbols to a digital system are encoded with two
distinct symbols. These symbols are 0(zero) and 1(one) and are known as
binary digits or bits. Bits can be stored and processed reliably and
inexpensively with currently available electronic circuits.
II. Rules for manipulating symbols are to be precisely specified such that a
machine can be built to execute each rule. The rules for manipulation are
also encoded using binary digits.
III. A digital computer has a storage unit in which the symbols to be
manipulated are stored. The encoded rules for manipulating the symbols
are also stored in the storage unit.
IV. Bit manipulation rules are realized by electronic circuits. Examples of simple
manipulation rules are: add two bits, compare two bits and move one bit
from one storage unit to another. A sequence of rules for accomplishing a
complex task may be stored in the storage unit and is called a program.
Digital systems work in a binary fashion, in which only two digits 0 and 1,
known as bits are used to specify any number. A group of eight bits is known as
byte and a group of four bits is known as a nibble. For example 10010001 is a
byte and 1011 is one nibble. Since a digital system understands only 0’s and 1’s,
any information, which is usually in numeric, alphabetic or alphanumeric form, is
to be suitably converted into the binary language before it can be processed by
digital circuits. This process is known as coding.
Program And Data:
Data means names, numbers and facts, anything needed to work
out a problem. Data goes into a computer, where it is processed or manipulated
to get new information. Before it goes into a computer, however the data must
be coded in binary form. The reason was given earlier a computers circuits can
respond only to binary numbers.
Besides the data, someone has to work out a program, a list of
instructions telling the computer what to do. These instructions spell out each
and every step in the data processing. Like the data, the program must be coded
in binary form before it goes into the computer. Once the computer run starts
each instruction is executed and the data is processed.
2. NUMBER SYSTEMS AND CODES:
-2-
-3The most widely used number system is the positional system. In this
system the position of various digits indicates the significance to be attached to
that digit. Positional number systems have a radix or a base. In the decimal
system the radix is 10.
Characteristics of commonly used Number System
Number
Base
Symbols used
Example
System
Binary
2
0,1
1011.11
Octal
8
0,1,2,3,4,5,6,7
3567.25
Decimal
10
0,1,2,3,4,5,6,7,8,9
3974.576
Hexa-decimal
16
0,1,2,3,4,5,6,7,8
3FA9.56
9,A,B,C,D,E,F
Base Or Radix:
The base or radix of a number system equals the number of digits it has.
Decimal numbers have a base of 10 because digits 0 through 9 are used. Binary
numbers have a base of 2 because only the digits 0 and 1 are used. A subscript
attached to a number indicates the base of the number.
Positional Notation And Weights:
The decimal number system uses positional notation. Each digit position
has a weight or value. For decimal number the weights are units, tens,
hundreds, etc., The sum of all the digits multiplied by their weights gives the
total amount.
Example:
For Decimal Number:
Number = (2342)10
2’s weight is 1000=103
3’s weight is 100=102
4’s weight is 10=101
2’s weight is 1=100
therefore 2342 = 2*1000 + 3*100 + 4*10 + 2*1
= 2000+300+40+2( In powers of 10 2*103 + 3*102 + 4*101+2*1)
For Binary Number:
Number = 101
1’s weight is 100=102
0’s weight is 10=101
1’s weight is 1=100
therefore 111 = 1*100 + 0*10 +1*1
=100+0+1
=101
4. BINARY TO DECIMAL CONVERSION:
To convert a binary number into decimal number, multiply each binary digit
by its positional weight and add them.
To simplify the conversion, the following steps may be followed:
1) write the binary number
2) write the numbers (weights) 1,2,4,8,16 (20,21,22,23,24…) directly under
each digit of the binary integer number starting from the digit next to
binary point towards left.
3) Whenever zero appears in the given binary number, the corresponding
weights written below the ‘0’s can be neglected and by adding the
remaining weights the decimal equivalent is obtained.
Example
-3-
-4Conteger Integer Part to decimal equivalent:
Convert (10011)2 to decimal equivalent
Step
Step
Step
Step
1
2
3
4
:
:
:
:
1
0
16
8
16
8
16+2+1 = 19
0
4
4
1
2
2
1
1
1
(10011)2 = (19)10
Converting Fractional part to decimal equivalent:
Converting fraction to decimal is same as converting binary integer to decimal
equivalent except that the weights of digit positions (1,2,4,8,16…..) are to be replaced
with ½, ¼ ,1/8,1/16 (i.e 2-1,2-2,2-3,2-4 ) starting from the binary digit next to the decimal
point towards right.
Convert (0.1011)2 to decimal equivalent
Step
Step
Step
Step
1
2
3
4
:
:
:
:
1
0
1
1
0.5
0.25
0.125
0.0625
0.5
0.25
0.125
0.0625
0.5 + 0.125 + 0.0625= 0.6875
(0.1011)2 = (0.6875)10
4. DECIMAL-TO-BINARY CONVERSION:
To convert decimal numbers to binary numbers double dabble method is
followed. In this method divide the decimal number by 2, writing down the
remainder after each division till we get the quotient zero. Then the remainders
are written sequentially with the last remainder at the left most extreme and the
first remainder at the right most extreme.
Example:
Conversion Of An Integer From Decimal To Binary
1.convert (17)10 to binary
2
17
2
8
1
2
4
0
2
2
0
1
0
1. First divided 17 by 2 to get an integer
quotient of 8 and remainder as 1.
2. Then the quotient 8 is divided by 2 to a new
quotient and remainder.
3. This process is repeated until the integer
quotient becomes 1.
(17)10=(10001)2
Conversion Of Fraction To A Binary
The conversion of fraction to binary is same as conversion of integer to
binary except that multiplication is used instead of division and integers are
accumulated instead of remainders.
convert (0.6875)10 to binary
a) 0.6875 is multiplied by 2 to give an integer and a fraction.(1.3750)
b) The new fraction (0.3750) is multiplied by 2 to give a integer and a new
fraction.(0.7500)
c) This process is repeated until the fraction becomes 0 or the number of digits
have sufficient accuracy.
0.6875 * 2 =
Integer
1
+
Fraction
0.3750
-4-
Coefficient
a-1 =1
-50.3750 * 2 =
0.7500 * 2 =
0.5000 * 2 =
0
1
1
+
+
+
0.7500
0.5000
0.0000
a-2 =0
a-3 =1
a-4 =1
Answer : (0.6875)=( 0.a-1 a-2 a-3 a-4 )2 = (0.1011)2
5. OCTAL NUMBER SYSTEMS:
Since binary numbers are long and cumbersome to represent directly it is
customary to represent by a number system, which is closely related to binary.
There are two types of such systems used namely Octal and Hexadecimal
Systems. Though a number is referred by any of these systems it is stored only
in equivalent binary digits. The reason for using these systems in the latest
computers, is that it represents a number in a simple form.
OCTAL NUMBER SYSTEM:
In octal number system the base is 8 and the digits vary from 0 to 7. The
position of a digit to the left carries a weightage in ascending powers of 8 similar
to the binary system. It may be noted that one digit of Octal System is
equivalent to 3 digits of the corresponding positions in a binary to represent the
same value.
Conversion Of Decimal Number To Octal Number:
To convert the octal number to decimal, use octal dabble method similar
to double dabble method of binary number system. Divide the number by 8 to
obtain the quotient and remainder. Repeat the same process of dividing the
number(quotient) >=1 and < 8 as the final remainder. The remainders in the
reverse order form the octal number.
Example:
Conversion of decimal integer to octal:
convert (175)10 the decimal number to octal number
8
175
8
21
7
2
5
1. First divided 175 by 8 to get an integer
quotient of 21 and remainder as 8.
2. Then the quotient 21 is divided by 8 to a
new quotient(2) and remainder(5).
3. This process is repeated until the integer
quotient becomes less than 8.
Conversion of decimal fraction to octal:
The conversion of fraction to octal is same as conversion of integer to
octal except that multiplication is used instead of division and integers are
accumulated instead of remainders.
convert (0.23)10 to octal
1. 0.23 is multiplied by 8 to give an integer(1) and a fraction (0.84).
2. The new fraction 0.84 is multiplied by 8 to give a integer and a new
fraction.
3. This process is repeated until the fraction becomes 0 or the number of
digits have sufficient accuracy.
0.23 * 8 =
0.84 * 8 =
0.72 * 8 =
Integer
1
6
5
+
+
+
Fraction
0.84
0.72
0.76
Coefficient
a-1 =1
a-2 =6
a-3 =5
Answer : (0.23)=( 0.a-1 a-2 a-3 )8 = (0.165)10
Conversion Of Octal number To Decimal Equivalent:
-5-
-6To convert an octal number into decimal, multiply each octal digit by its
weights and add the resulting products.
Example:
Convert (237.42)8 to decimal equivalent
(237.42) 8 =
=
=
=
(2*82) + (3*81) + (7*80) + (4*8–1) + (2*8–2)
2*64 + 3* 8 + 7 + 4/8 + 2/64
128 + 24 + 7 + 0.5 + 0.0312
(159.5312) 10
(237.42)8 = (159.5312)10
Conversion of Octal Number To Binary Equivalent:
The conversion from octal to binary number becomes simple since the base
of octal number 8 is the third power of 2, the base of binary numbers. Here each
octal digit if replaced by its 3 binary equivalent.
Example:
Conversion of an octal integer to binary equivalent
The binary equivalent for the (634)8 is converted directly as follows
1.The first digit 4 is equivalent to 100
2.The second digit 3 is equivalent to 011
3.The third digit 6 is equivalent to 110
Therefore (634)8 = (110 011 100)2
Conversion of an octal fraction to binary equivalent
The binary equivalent for the (34.56) 8 is converted directly as follows
1.The first digit 3 is equivalent to 011
2.The second digit 4 is equivalent to 100
3.The third digit 5 is equivalent to 101
3.The fourth digit 6 is equivalent to 110
Therefore (34.56)8 = ( 011 100 . 101 110) = (011100.101110) 2
Conversion of Binary To Octal Conversion:
Large binary numbers can be converted into octal by grouping the bits in
three, stating at the binary point and then converting each group of three to its
octal equivalent (0’s are added at each end, if necessary)
Example:
1.Convert the binary number (1011.01101)2 into octal
(1011.01101)2 = 001 011 . 011 010
=1
3 . 3
2
Therefore the octal number of (1011.01101) 2 is (13.32)8
2.Convert the binary number (10101011)2 into octal (adding zero’s at left end)
(1011.01101)2 = 010 101 . 011
= 2
5 . 3
Therefore the octal number of (10101011)2 is (253)8
Advantage of using octal over Binary:
1. Octal number system requires less circuit because octal number are easier
to read, record and print then binary numbers.
-6-
-72. Large decimal numbers are easily converted to binary if we first convert to
octal and then to binary. The reason is that a direct decimal-to-binary
conversion requires many division than a decimal to octal conversion.
6. HEXADECIMAL NUMBER SYSTEM:
The number system having 16 as its base or radix is known as the Hexa
Decimal Number System. It has 16 digits, which are 0,1,2,3,4,5,6,7,8,9,A, B, C,
D, E, and F. It means that a hexadecimal number is a string consisting of 0 to 9
decimal digits and A to F alphabets. The alphabets A to F represents the decimal
numbers 10 to 15 example (79BE) 16 is a hexadecimal number in which B stands
for the digit 11 and E stands for 14.
Conversion Of Decimal To HexaDecimal:
One method to convert the Decimal to Hexadecimal is the Hex Dabble method.
In this method divide the decimal number by 16 the base of hexadecimal system
writing down the remainders after each division. The remainders in reverse order
form the hexadecimal form
Example:
1. Conversion of decimal into hexadecimal (934)10
16
42077
13(D)
16
2629
5
16
164
4
1. First divided 42077 by 16 get an integer
quotient of 2629 and remainder as 5.
2. Then the quotient 2629 is divided by 16
to a new quotient(164) and
remainder(4).
3. This process is repeated until we get the
quotient less than 16 as the final
remainder.
10(A)
Therefore the hexadecimal A45D is equivalent to 422077.
Conversion of Decimal fraction to Hexadecimal equivalent:
The conversion of fraction to Hexadecimal is same as conversion of
integer to Hexdecimal except that multiplication is used instead of division and
integers are accumulated instead of remainders.
Example:
2. Convert (0.85)10 into hexadecimal
1. 0.85 is multiplied by 16 to give an integer(13) and a fraction (0.60).
2. The new fraction 0.60 is multiplied by 16 to give a integer and a new
fraction.
3. This process is repeated until the fraction becomes 0 or the number of
digits have sufficient accuracy.
0.85 * 16 =
0.60 * 16 =
0.60 * 16 =
Integer
13
9
9
+
+
+
Fraction
0.60
0.60
0.60
Answer : (0.85)16 = (0. a-1 a-2 a-3 ) 8 = ( 0.D99 )10
-7-
Coefficient
a-1 =13
a-2 =9
a-3 =9
-8-
Conversion Of Hexadecimal To Decimal:
The positional weightage of each digit in the hexadecimal number is in powers
of 16. Multiply each Hexadecimal digit by its weight and add the resulting
product.
Example:
Convert (A6B8)16 to decimal equivalent.
(A6B8)16 = (A*163) + (6*162) + (B*161) + (8 *160)
= (10 * 4096) + (6* 256) + (11*16) + 8
= 40960 + 1536 + 176 + 8 = 42680
Therefore (A6B8)16 = (42680)10
Conversion of Hexadecimal To Binary Conversion:
In this , the base of hexadecimal number system 16 is the fourth power of 2
(i.e 24) which is the base of binary numbers. Therefore for converting
hexadecimal number into binary, each hexadecimal digits has to be replaced by
its 4 bit binary equivalent.
Example :
Conversion of hexadecimal integer to binary equivalent
Convert (A94)16 to binary equivalent.
1. The binary equivalent of A is 1010
2. The binary equivalent of 9 is 1001
3. The binary equivalent of 4 is 0100
Therefore (A94)16 = (1010 1001 0100)2
Conversion of Hexadecimal fraction binary
The binary equivalent for the (34.56)16 is converted as
follows
1. The first digit 3 is equivalent is 0011
2. The second digit 4 is equivalent is 0100
3. The third digit 5 is equivalent is 1000
4. The fourth digit 6 is equivalent to 0110
Therefore (34.86)16 = ( 0011 0100.1000 0110) 2 = (00110100.10000110) 2
Conversion of Binary To Hexadecimal:
Binary numbers can be converted into its equivalent hexadecimal number
by grouping the bits in four, starting from the binary point and then converting
each group of four to its hexadecimal equivalent ( 0’s are added at each end, if
necessary)
Example:
Convert binary into hexadecimal number
(111101010110)2 = 1111 0101 0110
= F
5
6
(111101010110)2 = (F56)16
7. ASCII CODE:
To get information into and out of a computer, we need to us some kind of
alphanumeric code for letters, numbers, and other symbols. At one time ,
manufacturers used their own alphanumeric codes, which led to all kinds of
confusion. To avoid the discrepancies an common standard for input-output
code known as the American Standard Code for Information Interchange is
followed by all the industries. This code allows manufacturers to standardize
computer hardware such as keyboards, printers, and video displays.
The ASCII code is a 7-bit code whose format is
X6X5X4X3X2X1X0
-8-
-9-
ASCII CODE
X3x2x1x0
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110
1111
X6X5X4
010
SP
!
“
#
$
%
&
‘
(
)
*
+
,
.
/
011
0
1
2
3
4
5
6
7
8
9
:
;
<
=
>
?
100
@
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
101
P
Q
R
S
T
U
V
W
X
Y
Z
110
a
b
c
d
e
f
g
h
I
j
k
l
m
n
o
111
p
q
r
s
t
u
v
w
x
y
z
The letter A has X6X5X4 as 100 and X3x2x1x0 as 0001. Therefore the ASCII
code is 100 0001. In the same way the ASCII for d is 110 0100 and $ is
010 0100. In the above table SP stands for blank space.
Parity Bit:
The ASCII code is used for sending digital data over Telephone lines, 1 biterror may occur in Transmitted data. To Catch these errors, a parity bit is
usually transmitted along with the original bits. Then a parity checker at the
receiving end can test for even or odd parity, whichever parity has been
prearranged between the sender and the receiver. Since ASCII code uses 7
bits, the addition of a parity bit to the transmitted data produces an 8-bit
number in this format:
X7x6x5x4x3x2x1x0
Parity bit.
8. GRAY CODE:
Each Gray-code number differs from the preceding number by a single bit.
The numbers differs in their Most significant bits. The conversion from binary to
gray code is as follows
1. The leftmost digit of the binary number is also the leftmost digit of the
gray code.
2. The mod 2 sum (0⊕ 0 =1⊕ 1=0 and 1⊕ 0 =0 ⊕ 1=1) of the two leftmost
digits in the binary number will ggive the second leftmost digit in the Gray
code.
3. The mod 2 sum of the second and third digits of the binary number give
the third leftmost digit of the gray code. This rule continues until the mod
2 sum of the two rightmost digit of the binary number give the rightmost
gray code digit.
-9-
- 10 Example :
conversion of the binary to Gray code is:
0111 : binary
0
leftmost digit
0⊕1 =1
d leftmost digit
1⊕1 =0
next digit
1⊕1 =0
rightmost digit
Therefore the gray code of 0111 binary is 0100
Decimal
Gray Code
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
0000
0001
0011
0010
0110
0111
0101
0100
1100
1101
1111
1110
1010
1011
1001
1000
9. EXCESS – 3 CODE
One of the first, a code that was used in the early Mark machines built at
Harvard and has been used a good deal since , is known as the Excess – 3 code.
The Excess-3 code is a 4-bit code used with Binary Coded Decimal (BCD). To
convert a decimal number into Excess-3 form add 3 to each digit, and then
convert the sum to BCD number.
For, instance, to form the excess-3 representation for 29 , first 3 is added to 2
yielding 5 and 3 is added to 9 to yield 12.
2
9
+3
3
---------5
12
----------0101
1100
The Excess-3-code for 29 is 01011100
DECIMAL BCD
EXCESS-3
CODE
0
0000
0011
1
0001
0100
2
0010
0101
3
0011
0110
4
0100
0111
5
0101
1000
6
0110
1001
7
0111
1010
8
1000
1011
9
1001
1100
- 10 -
- 11 -
In general, EXCESS- 3- CODE number is 3 greater than the BCD
equivalent.
BINARY CODED DECIMAL REPRESENTATION
In most of the electronic circuit elements used to construct digital computers
are inherently binary in operation , the binary number system is the most natural
number system for a computer. Also computers constructed with the binary
number system require a smaller amount of circuitry and so are more efficient
than machines operating in other number systems. However, the decimal
systems has been used for a long time , and there is a natural reaction to
performing calculations in a binary number system. Also, since cheque, bills,
Tax rates, prices etc., are all figures in the decimal system , the values of the
most things may be converted from the decimal to the binary before
computation can begin. For these reasons , most of the early machines operated
in binary coded decimal number systems. In such systems a coded group of
binary bits is used to represent each of the 10 decimal digits. For instance , an
obvious and natural code is simple weighted binary code
Binary code
Decimal
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
0
1
2
3
4
5
6
7
8
9
This is known as Binary – coded decimal 8,4,2,1 code or simply BCD. 4 digits
are required for each decimal digit, and each bit is assigned a weight. This is a
very useful code and has been much used. One difficulty with the code ,
however lies in forming the complements of numbers in this system. It is
common practice to perform subtraction in the computer by adding the
complement of the subtrahend.
Binary Addition:
Binary addition is performed in the same manner as decimal addition. The
complete table for binary addition is
0
0
1
1
+
+
+
+
0
1
0
1
=
=
=
=
0
1
1
0 plus a
carry of 1
Example:
101101
11100
1010111
+110101
+11010
+0011011
1100010
110110
1110010
Binary Subtraction:
When 1 is subtracted from 0. The remainder is 1, but it is necessary to
borrow. The binary subtraction table is
0
1
1
0
-
0
0
1
1
=
=
=
=
0
1
0
1 with a borrow of 1
- 11 -
- 12 -
Example:
111
-101
-----010
------
1101
-1010
-------0011
--------
11001
-1110
--------1011
---------
1111
-1011
------100
--------
11011
-101
--------10110
----------
Binary Multiplication:
Each digit is separately multiplied and then the values are added
The binary multiplication table is
0
1
0
1
*
*
*
*
0
0
1
1
=
=
=
=
0
0
0
1
Example:
1)
1100
X1100
--------------0000
1100
0000
1100
-------------ans 1111000
--------------
2)
1100110
X1000
-----------------ans 1100110000
------------------
Binary Divisions:
In the decimal system division by zero is meaningless. The complete table is
0/1=
1/1=
0
1
Example:
100
1011
101100
1011
-----------000
-----------101100 / 1011 = 100
1’s Complement Of A Binary Numbers:
This is determined by replacing its 1’s by 0’s and 0’s by 1’s
Example:
The 1’s complement of 1010 is 0101
The 1’s complement of 111001 is 000110
The 1’s complement of 1110 is 0001
2’’s Complement Of A Binary Number:
2’s complement of a binary number is obtained by adding 1 to the least
significant digit of 1’s complement of that number
2’s complement of a number = 1’s complement of the number +1
Example :
Number : (1010)2
1’s complement is 0101
+1
-------
2’s complement is 0110
- 12 -
- 13 QUESTIONS:
Two Marks:
a.
b.
c.
d.
e.
f.
g.
h.
i.
j.
k.
l.
m.
n.
o.
p.
i)7
What is meant by Binary numbers?
Why Binary Numbers are used?
What is a bit?
Define Data.
Define Number System.
Define Hardware and Software.
Define Base or Radix.
Define Binary Coded Decimal.
Define Octal Numbers.
Define Hexadecimal Numbers.
Define Binary Coded Decimal.
Define ASCII Code.
Define 1’s Complement.
Define 2’s Complement.
Define Positional Notations and weights.
Give the ASCII code for each of these
ii) f iii) W iv) y.
Four Marks
1. Convert Binary to Decimal Numbers.
001,11101, 0100111, 100.10, 111.10101, 0.001101, 10110.011, 1.011.
2.Convert decimal numbers to equivalent binary numbers.
43, 64, 4096, 0.375, 27/32, 0.4375, 512.5, 131.5625, 2048.0645
3. Perform the addition and check by converting the binary numbers to decimal.
a) 1001.1+1011.01
b) 100101+100101
b) 0.1011+0.1101
c) 1011.01+1001.11
d) 1011+11101
e) 11111.1+10010.1
f) 101.1+111.
4. Perform the subtraction and check in binary and check by converting the
number into decimal.
a) 1101-1000
b) 1101-1001
c) 1011.1-101.1
d) 1101.01-1011.1
e) 111.11-101.1
f) 1101.1-1010.01
5. Perform then subtraction in the binary number system
a) 64-32
b) 127-63
c) 93.5-42.75
d) 84 9/32 – 48 5/16
e) 128-32
f) 1/8 - 1/16
g) 31- 5/8
h) 62-31 1/16
i) 129-35
j) 94.5-43.75
- 13 -
- 14 -
6. Perform the Following multiplications and divisions in the binary system
a) 16*8, b) 31* 14, c) 23 * 356.32, d) 15*8.625, e) 24*12, f) 31* 14, g) 49.5 *
51.75, h) 6/2, I) 16/8, j) 27/18, k) 32/8, l) 58.75/23.5, m) 31.5/15.75, n) 3/ 5/8,
2 5/8/ 15/8, O, m) 256 ½ / 128 ¼
7. Convert the following binary numbers to 1’s Complement
and 2’s
Complement.
1011,1101,1010,1111,1110,1011, 11010,0.0111,0.101,11.101,101.011,
10111.10,10111.110
8. Perform the following subtractions of binary numbers, using both 1’s and 2’s
Complements:
1010 – 1011 , 110 –10 , 110 – 0.1111 , 0.111 – 0.1001 , 0.1111 – 0.101 ,
11.11 – 10.111.
9. Convert the following hexadecimal numbers to decimal numbers
1.
2.
3.
4.
5.
6.
7.
8.
9.
15
B8
AB4
9.B
9.1A
B6C7
]64AC
A492
D2763.
10. Convert the following octal numbers to decimal:
1. 15
2. 125
3. 115
4. 124
5. 156
6. 15.6
7. 2376
8. 4567
9. 24563
10. 324533
11. Convert the Binary numbers to octal:
110, 1111101, 111.1111, 0.11111, 10.11, 11111.101101, 1011101,
011.10101
- 14 -