0% found this document useful (0 votes)
2 views

Number system & bynary arithmetic

The document provides an overview of number systems and binary arithmetic, detailing the historical context and the importance of numbers in human civilization. It outlines learning objectives, definitions, types of number systems (decimal, binary, octal, hexadecimal), and methods for converting between these systems. Additionally, it covers binary arithmetic operations such as addition, subtraction, multiplication, and division, with examples for clarity.

Uploaded by

Romeo Tietche
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Number system & bynary arithmetic

The document provides an overview of number systems and binary arithmetic, detailing the historical context and the importance of numbers in human civilization. It outlines learning objectives, definitions, types of number systems (decimal, binary, octal, hexadecimal), and methods for converting between these systems. Additionally, it covers binary arithmetic operations such as addition, subtraction, multiplication, and division, with examples for clarity.

Uploaded by

Romeo Tietche
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Ministry of Secondary Education Republic of Cameroon

Progressive Comprehensive High School Peace – Work – Fatherland


PCHS Mankon – Bamenda School Year: 2014/2015
Department of Computer Studies

NUMBER SYSTEMS & BINARY ARITHMETIC


Class: Comp. Sc. A/L By: DZEUGANG PLACIDE

Since the early days of human civilization, people have been using their fingers, sticks and
other things for counting. As daily activities became more complex, the numbers became more
important in trade, time and distance, and in all other spheres of human life. It became apparent
that we needed more than our fingers and toes to keep track of the number in our daily routine.
In 3400 BC, the ancient Egyptians started using special symbols for writing the numbers. This
was a major advancement, because it reduced the number of symbols required. However, it
was difficult to represent large or small numbers by using such a graphical approach.

Learning objectives
After studying this lesson, student should be able to:
 Recognize different types of number systems as they relate to computers.
 Identify and define unit, number, base/radix, positional notation, and most and least
significant digits as they relate to decimal, binary, octal, and hexadecimal number
systems.
 Add and subtract in binary, octal, and hexadecimal number systems.
 Convert values from decimal, binary, octal, hexadecimal, and binary-code decimal
number systems to each other and back to the other systems.
 Add in binary-coded decimal.

Contents
I. DEFINITIONS ................................................................................................................................ 2
II. TYPES OF NUMBER SYSTEM ................................................................................................... 2
III. CONVERSION BETWEEN NUMBER BASES ....................................................................... 3
IV. BINARY ARITHMETIC ............................................................................................................ 8
V. REPRESENTATION OF NEGATIVE BINARY NUMBER ........................................................ 9
VI. BINARY CODING SCHEME.................................................................................................. 12
EXERCISES.............................................................................................................................................. 14

This topic and others are available on www.dzplacide.overblog.com in PDF format


Topic: Number Systems & Binary arithmetic 2 By DZEUGANG Placide

I. DEFINITIONS

A number system defines a set of values that is used to represent quantity. It is characterize
by the base or radix. The base tells the number of symbols used in the system. Then tha system
of base n will use digits from 0 to n-1. E.g. Base 3 uses the digits 0, 1 and 2. Base 6 uses the
digits 0, 1, 2, 3, 4 and 5.

The base of a number system is indicated by a subscript (decimal number) and this will be
followed by the value of the number. The following are few examples:

 (7592)10 is of base 10 number system.

 (214)8 is of base 8 number system.

 (123)16 is of base 16 number system

II. TYPES OF NUMBER SYSTEM

Eventually, the number systems that are generally used by the computers are as follows:

• Decimal number system


• Binary number system
• Octal number system
• Hexadecimal number system
Number System Radix Value Set of Digits Example
Decimal r = 10 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 (25)10
Binary r=2 0, 1 (11001)2
Octal r=8 0, 1, 2, 3, 4, 5, 6, 7 (31)8
Hexadecimal r = 16 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F (19)16
Table 1. Types of Number Systems

Factorisation.

Let consider the number N of n digits in base b written as follow: (𝑫𝒏−1 … 𝑫2 𝑫1 𝑫0 )𝒃. N can
be also written

𝑵 = 𝑫𝒏−1 𝒃𝒏−1 + ⋯ + 𝑫𝒊 𝒃𝒊 + ⋯ + 𝑫2 𝒃2 + 𝑫1 𝒃1 + 𝑫0 = ∑𝒏−1


0 𝑫𝒊 𝒃𝒊

Example. (7954)10 = 7 × 103 + 9 × 102 + 5 × 101


= 7 × 1000 + 9 × 100 + 5 × 10 + 4
(11010)2 = 1 × 2 + 1 × 2 + 0 × 22 + 1 × 21 + 0
4 3

(453)7 = 4 × 72 + 5 × 7 + 3
(5𝑨𝑫03)16 = 5 × 164 + 𝐴 × 163 + 𝐷 × 162 + 0 × 16 + 3
= 5 × 164 + 10 × 163 + 13 × 162 + 0 × 16 + 3

This topic and others are available on www.dzplacide.overblog.com in PDF format


Topic: Number Systems & Binary arithmetic 3 By DZEUGANG Placide

Decimal Binary Octal Hexadecimal


1 0001 1 1
2 0010 2 2
3 0011 3 3
4 0100 4 4
5 0101 5 5
6 0110 6 6
7 0111 7 7
8 1000 10 8
9 1001 11 9
10 1010 12 A
11 1011 13 B
12 1100 14 C
13 1101 15 D
14 1110 16 E
15 1111 17 F

III. CONVERSION BETWEEN NUMBER BASES

We have discussed earlier that internally the computer uses binary numbers for data
representation, whereas externally it uses decimal numbers. However, any number in one
number system can be represented in any other number system. Conversion between number
systems can be classified into three types: Coding, decoding and encoding.

III.1. Coding
Coding is the conversion from decimal base (base 10) to any non-decimal base b ( 𝑏 ≠ 10).

IV.1.1 Coding of whole numbers

III.1.2 Conversion of Decimal Fractions


Examples:
a) Determine the binary equivalent of (0.375)10.
0.375 x 2 = 0.750 0
0.75 x 2 = 1.50 1

This topic and others are available on www.dzplacide.overblog.com in PDF format


Topic: Number Systems & Binary arithmetic 4 By DZEUGANG Placide

0.5 x 2 = 1.0 1
Finally, (0.375)10 = (0.011)2

b) Determine hexadecimal conversion of (671.175)10

We have already noticed in the previous question that (671)10 = (29F)16. Now let convert
(0.175)10 in base 16

0.175 x 16 = 2.8 2
0.8 x 16 = 12.8 C
0.8 x 16 = 12.8 C
....
Finally, (671.175)10 = (29F.2CCC...)16

III. 2. Decoding
To decode is convert from a non-decimal base b (𝑏 ≠ 10) to the decimal base (base 10).

III.2.1 Conversion of whole numbers

In this case, each digit of the binary number is multiplied by its weighted position, and each of
the weighted values is added together to get the decimal number.

Examples:

a) Convert 2358 into base 10.

The Process:
Above each of the digits in your number, list the power of the base that
the digit represents. See the example on the left. It is now a simple
process of multiplication and addition to determine your base 10
number. In this example you have
Now simply add these values together.
5 x 80 = 5 5 + 24 + 128 = 157
3 x 81 = 24 Answer: 2358 = 15710
2 x 82 = 128
**Remember: any number to the zero power equals one.
b) Convert 10112 to base 10.

1 x 20 = 1
1 x 21 = 2 1 + 2 + 0 + 8 = 11
0 x 22 = 0 Answer: 10112 = 1110
1 x 23 = 8
c) Convert 1C416 to base 10.

4 x 160 = 4 4 + 192 + 256 = 452


C x 161 = 12 x 161 = 192
Answer: 1C416 = 45210
1 x 162 = 256

This topic and others are available on www.dzplacide.overblog.com in PDF format


Topic: Number Systems & Binary arithmetic 5 By DZEUGANG Placide

III.2.2 Conversion of non-decimal fractions to decimal fraction

Examples:

a) Determine the decimal equivalent of (0.01101)2.

Thus, the decimal equivalent of (0.01101)2 is (0.40625)10.

b) Determine the decimal equivalent of (237.04)8.

Sum of weight of all bits = 128 + 24 + 7 + 0 + 0.0625 = 159.0625

Thus, the decimal equivalent of (237.04)8 is (159.0625)10.

c) Determine the decimal equivalent of (45C.8BE3)16.

Sum of weight of all bits = 1024 + 80 + 12 +0.5 + .0429687 + .0034179 + .0000457=


1116.5464323

Thus, the decimal equivalent of (45C.8BE3)16 is (1116.5464323)10.

III.3. Encoding
Encoding is the conversion from a non-decimal base to a non-decimal base. Some special
cases would be distinguished.

III.3.1 Conversion of Binary to Hexadecimal

Examples:

a) Determine the hexadecimal equivalent of (101011110011011001)2

This topic and others are available on www.dzplacide.overblog.com in PDF format


Topic: Number Systems & Binary arithmetic 6 By DZEUGANG Placide

The hexadecimal equivalent of (101011110011011001)2 is (2BCD9)16.

b) Determine the hexadecimal equivalent of (1100001.101011110011)2.

The hexadecimal equivalent of (1100001.101011110011)2 is (61.AF3)16.

III.3.2 Conversion of Hexadecimal to Binary

Examples:

a) Determine the binary equivalent of (5AF)16.

Combining the four bits of the binary-coded values, we have 010110101111.

Thus, the binary equivalent of (5AF)16 is (010110101111)2.

b) Determine the binary equivalent of (2B.6C)16.

Combining the four bits of the binary-coded values, we have 00101011.01101100.

Thus, the binary equivalent of (2B.6C)16 is (00101011.01101100)2.

III.3.3 Conversion of Octal to Hexadecimal

Examples:

a) Determine the hexadecimal equivalent of (2327)8.

Combining the three-bit binary blocks, we have 010011010111.

Dividing the group of binary numbers into the four-bit binary blocks and by converting these
blocks into their respective hexadecimal symbols, we have:

Thus, the hexadecimal equivalent of (2327)8 is (4D7)16.

This topic and others are available on www.dzplacide.overblog.com in PDF format


Topic: Number Systems & Binary arithmetic 7 By DZEUGANG Placide

b) Determine the hexadecimal equivalent of (31.57)8.

Combining the three-bit binary blocks, we have 011001.101111.

Dividing the group of binary numbers into the four-bit binary blocks and by converting these
blocks into their respective hexadecimal symbols, we have:

Thus, the hexadecimal equivalent of (31.57)8 is (19.BC)16.

III.3.4 Conversion of Hexadecimal to Octal

Examples:

a) Determine the octal equivalent of (5DE247)16.

Combining all the four-bit binary blocks, we have 010111011110001001000111.

Dividing the group of binary numbers into the three-bit binary blocks and by converting these
blocks into their respective octal symbols, we have:

Thus, the octal equivalent of (5DE247)16 is (27361107)8.

b) Determine the octal equivalent of (7B.64D)16.

Combining all the four-bit binary blocks, we have 01111011.011001001101.

Dividing the group of binary numbers into the three-bit binary blocks and by converting these
blocks into their respective octal symbols, we have:

Thus, the hexadecimal equivalent of (7B.64D)16 is (173.3115)8

This topic and others are available on www.dzplacide.overblog.com in PDF format


Topic: Number Systems & Binary arithmetic 8 By DZEUGANG Placide

IV. BINARY ARITHMETIC

The arithmetic operations - addition, subtraction, multiplication and division, performed on


the binary numbers is called binary arithmetic

IV.1 Binary addition


 0+0=0
 0+1=1
 1+0=1
 1 + 1 = 0, and carry 1 to the next more significant bit
Examples,

a) 00011010 + 00001100 = 00100110 b) 00010011 + 00111110 = 01010001

1 1 carries 1 1 1 1 1 carries
0 0 0 1 1 0 1 0 = (26)10 0 0 0 1 0 0 1 1 = (19)10
+0 0 0 0 1 1 0 0 = (12)10 +0 0 1 1 1 1 1 0 = (62)10
0 0 1 0 0 1 1 0 = (38)10 0 1 0 1 0 0 0 1 = (81)10

IV.2 Binary Subtraction

Rules of Binary Subtraction

0‐0=0
0 ‐ 1 = 1, and borrow 1 from the next more significant bit
1‐0=1
1‐1=0

Examples,
a) 00100101 ‐ 00010001 = 00010100 b) 00110011 ‐ 00010110 = 00011101

1 borrows 11 borrows
00100101 = (37)10 00110011 = (51)10
‐ 00010001 = (17)10 ‐ 00010110 = (22)10
00010100 = (20)10 00011101 = (29)10

IV.3 Binary Multiplication


The multiplication process for binary numbers is similar to that for
decimal numbers. Partial products are formed, with each product shifted
one place to the left. This is illustrated below.

Rules of Binary Multiplication


Example, a) 111 x 101

This topic and others are available on www.dzplacide.overblog.com in PDF format


Topic: Number Systems & Binary arithmetic 9 By DZEUGANG Placide

b) 101001 × 110 = 11110110


101001 = (41)10
× 110 = (6)10
000000
101001
101001
11110110 = (246)10

IV.4 Binary division


Binary division follows a similar process to that of decimal division.
Example: Divide (a) (15)10by (5)10 in binary form, and (b) (15)10 by (6)10 in binary form.

V. REPRESENTATION OF NEGATIVE BINARY NUMBER

Usually a given computer uses a fixed number of bits for storing integers. So we use terms such
as 8-bits integer, 16-bits integers, ... Whatever the principle remains the same, the only
difference is that with more bits, we can store wider range of number. In general, with n bits,
one can store 2n numbers.

V.1 Signed magnitude representation


In the sign magnitude representation, the sign of a binary number has to be represented using
0 and 1, in the computer. An n-bit signed binary number consists of two parts – sign bit and
magnitude. The left most bit, also called the Most Significant Bit (MSB) is the sign bit. The
remaining n-1 bits denote the magnitude of the number.

For

example, 01100011 is a positive number since its sign bit is 0, and, 11001011 is a negative
number since its sign bit is 1. An 8-bit signed number can represent data in the range -128 to
+127 (-27 to +27-1). In general, using n bits, the range of integer we can store using two’s
complement is -2n-1 to 2n-1

V.2 Complements
The complement of a number is the number, which when added to the original will make it
equal to a multiple of the base number system.

For every base r system, there are two types of complements: rs complement and (r – 1)s
complement.

This topic and others are available on www.dzplacide.overblog.com in PDF format


Topic: Number Systems & Binary arithmetic 10 By DZEUGANG Placide

 For decimal r = 10, we have 9s and 10s complement.


 For binary r = 2, we have 1s and 2s complement.
 For octal r = 8, we have 7s and 8s complement.
 For hexadecimal r = 16, we have 15s and 16s complement.

There are two types of complements for the binary number system – 1’scomplement and
2’scomplement.

V.2.1 The 1s Complement

To form the negative of any number, first complement all the bits of that number. This result
is known as the 1s complement of the original number. This requires changing every logic 1
bit in a number to logic 0, and every logic 0 bit to logic 1.

For instance
• 1’s complement of 110 is 001
• 1’s complement of 1011 is 0100
• 1’s complement of 1101111 is 0010000

V.2.2 The 2s Complement

The 2’s complement is the convention used in most of the computers to represent negative
numbers.

To obtain the 2s complement of a number, there is a two-step process:

1. Take the 1s complement of the number by changing every logic 1 bit in the number to
logic 0 bit, and change every logic 0 bit to logic 1 bit.
2. Add 1 to the 1s complement of the binary number. Now, we have the 2s complement
of the original number. Here, we can notice that the MSB has become 1.

Taking the 2s complement of the number will cause the MSB to become 1. Using n bits, the
range of integer we can store using two’s complement is -2n-1 to 2n-1-1

For instance,

• 2’s complement of 110 is 001 + 1 = 010


• 2’s complement of 1011 is 0100 + 1 = 0101
• 2’s complement of 1101111 is 0010000 + 1 = 0010001

V.2.3 Subtraction using 1’s and 2’s complements

Here we do subtraction using addition! We use the signed 1’s complement or 2’s complement
representation to represent the negative numbers. The subtraction here is just supposed to be
an addition of a positive number and a negative number. Then:

 (-A) – (+B) = (-A) + (-B) (+B in subtraction is changed to –B in addition)


 (+A) – (+B) = (+A) + (-B) (+B in subtraction is changed to –B in addition)
 (-A) – (-B) = (-A) + (+B) (-B in subtraction is changed to +B in addition)

This topic and others are available on www.dzplacide.overblog.com in PDF format


Topic: Number Systems & Binary arithmetic 11 By DZEUGANG Placide

 (+A) – (-B) = (+A) + (+B) (-B in subtraction is changed to +B in addition)


To carry out subtraction using complement method, follow these steps:
 take the "complement" of the number we are subtracting (we will see how soon)
 add it to to the number we are subtracting from
 discard the extra "1" on the left

If a carry out occurs,


- Add it to the result in case of 1’s complement
- Discard the carry out bit in case of 2’s complement

Examples
With 2’s complement With 1’s complement

1. Add −8 to +3 3. Add −8 to +3
(+3) 0000 0011 (+3) 0000 0011
+(−8) 1111 1000 +(−8) 1111 0111
----------------- --------------------------
(−5) 1111 1011 (−5) 1111 1010

2. Add −5 to −2 4. Add −5 to −2
(−2) 1111 1110 (−2) 1111 1101
+(−5) 1111 1011 +(−5) 1111 1010
----------------- --------------------------
(−7) 1 1111 1001 : discard carry-out 1 1111 0111
+(1) 1: Add carry-out
----------------------------
(−7) 1111 1000

V.2.4 Notion of Overflow

If the result of an arithmetic operation is to too large (positive or negative) to fit into the
resultant bit-group, then arithmetic overflow occurs. In general, overflow occurs when adding
two positive numbers produces a negative result, or when adding two negative numbers
produces a positive result. Adding operands of unlike signs never produces an overflow
Notice that discarding the carry out of the most significant bit during Two's Complement
addition is a normal occurrence, and does not by itself indicate overflow

As an example of overflow, consider adding (80 + 80 = 160)10, which produces a result of


−9610 in 8-bit two's complement:

01010000 = 80
+ 01010000 = 80
--------------
10100000 = −96 (not 160 because the sign bit is 1.)

This topic and others are available on www.dzplacide.overblog.com in PDF format


Topic: Number Systems & Binary arithmetic 12 By DZEUGANG Placide

(largest +ve number in 8 bits is 127)

VI. BINARY CODING SCHEME

The alphabetic data, numeric data, alphanumeric data, symbols, sound data and video data, all
are represented as combination of bits in the computer. A code is made by combining bits of
definite size. Binary Coding schemes represent the data such as alphabets, digits 0-9, and
symbols in a standard code. A combination of bits represents a unique symbol in the data. The
standard code enables any programmer to use the same combination of bits to represent a
symbol in the data.

The binary coding schemes that are most commonly used are

 Binary Coded Decimal (BCD)


 American Standard Code for Information Interchange (ASCII)
 Extended Binary-coded Decimal Interchange Code (EBCDIC)
 Unicode

VI.1 Binary Coded Decimal (BCD)


Binary Coded Decimal (BCD) is a method of using binary digits to represent the decimal
digits 0–9. A decimal digit is represented by four binary digits. The BCD coding is the binary
equivalent of the decimal digit. BCD system was developed by the IBM (International Business
Machines) corporation. In this system, each digit of a number is converted into its binary
equivalent rather than converting the entire decimal number to its binary form. Similarly, letters
and special characters can be coded in the binary form.

Let us determine the BCD value for the decimal number 5319. Since there are four digits in the
decimal number, there are four bytes in the BCD number. They are:

Binary code decimal digits (0–9) are represented by using four bits. The valid combinations of
bits and their respective values are shown in the table below.

Table. Binary-coded Decimal

This topic and others are available on www.dzplacide.overblog.com in PDF format


Topic: Number Systems & Binary arithmetic 13 By DZEUGANG Placide

To represent the signs + and -, any of the remaining 4 bits patterns can be used. One convention
uses 1010 for + and 1011 for -. You can see that in one byte we can have either 2 digits or a
sign and one digit. Here we must use the full 4-bits representation of any digit (including the
leading 0s). Thus the BCD representation of 5319 is 0101001100011001 and not
101001100011001

VI.2 Extended Binary-coded Decimal Interchange Code (EBCDIC)


Once upon a time IBM invented EBCDIC. EBCDIC is an acronym for Extended Binary
Coded Decimal Interchange Code. It is a single byte (8 bit) character encoding standard that
is used in the IBM mainframe environment. IBM didn't invent just one version of EBCDIC
either but several different incompatible versions. The computing friendly and user friendly
thing would have been to use the already in existence ASCII standard.

 The Extended Binary Coded Decimal Interchange Code(EBCDIC) uses 8 bits (4 bits
for zone, 4 bits for digit) to represent a symbol in the data.
 EBCDIC allows 28= 256 combinations of bits.
 256 unique symbols are represented using EBCDIC code. It represents decimal
numbers (0-9), lower case letters (a-z), uppercase letters (A-Z), Special characters, and
Control characters (printable and non-printable e.g. for cursor movement, printer
vertical spacing etc.).
 EBCDIC codes are used, mainly, in the mainframe computers.

VI.3 American Standard Code for Information Interchange (ASCII)


The name ASCII is an acronym for: American Standard Code for Information Interchange.
It is a character encoding standard developed several decades ago to provide a standard way
for digital machines to encode characters. ASCII codes are of two types: ASCII-7 & ASCII-8.

 ASCII-7is a 7-bit standard ASCII code. In ASCII-7, the first 3 bits are the zone bits and
the next 4 bits are for the digits. ASCII-7 allows 27= 128 combinations. 128 unique
symbols are represented using ASCII-7.
 ASCII-8is an extended version of ASCII-7. It is an 8-bit code having 4 bits for zone
and 4 bits for the digit. ASCII-8 allows 28= 256 combinations. ASCII-8 represents 256
unique symbols. ASCII is used widely to represent data in computers.
 The ASCII-8 code represents 256 symbols.
o Codes 0 to 31 represent control characters (non-printable), because they are used
for actions like, Carriage return (CR), Bell (BEL) etc.
o Codes 48 to 57 stand for numeric 0-9.
o Codes 65 to 90 stand for uppercase letters A-Z.
o Codes 97 to 122 stand for lowercase letters a-z.
o Codes 128-255 are the extended ASCII codes.

VI.4 Unicode

This topic and others are available on www.dzplacide.overblog.com in PDF format


Topic: Number Systems & Binary arithmetic 14 By DZEUGANG Placide

Unicode is a universal character encoding standard for the representation of text which includes
letters, numbers and symbols in multi-lingual environments. It uses 32 bits (232= 4164895296
combinations) to represent a symbol in the data. Unicode codes can uniquely represent any
character or symbol present in any language like Chinese, Japanese, included mathematical
and scientific symbols are also represented in Unicode codes. An advantage of Unicode is that
it is compatible with the ASCII-8 codes. The first 256 codes in Unicode are identical to the
ASCII-8 codes.

EXERCISES
MCQ

1. Choose the correct answer from below for the result of the binary multiplication 1101 ×
110.
(a) 1001111, (b) 1010110, (c) 1001110, (d) 1011111.
2. Choose the correct answer from below for the result of the binary division 11011 ÷ 1001.
(a) 10, (b) 101, (c) 11, (d) 110.
3. Which of the following is the binary product 1001 × 111?
(a) 110111 (b) 111111, (c) 111011, (d) 111110.
4. Which of the following is the binary product 1101 × 1011?
(a) 10101111, (b) 10001111, (c) 10101011, (d) 10111011.
5. Which of the following is the binary division 10101 ÷ 11?
(a) 100, (b) 110, (c) 101, (d) 111.
6. Which of the following is the binary division 100011 ÷ 1010?
(a) 10.1, (b) 11.11, (c) 11.01, (d) 11.1.

Exercise 1.
(a) Convert the binary number 1011 into decimal form.
(b) Convert the binary number 1.011 into decimal form.
(c) Convert the numbers 15 and 12 into binary form, add the two binary numbers together and
convert the answer to decimal form to check that the sum is correct.
(d) Convert the numbers 9 and 6 into binary form. Use this to find 9 − 6 in binary form. Check
that the answer is correct by converting the binary answer into decimal form.

Exercise 2.
In each of the questions below, a product is written in decimal form. In each case, convert both
numbers to binary form, multiply them in binary form and check that the solution is correct by
converting the answer to decimal form. (Click on the green letters for solutions.)
(a) 3 × 2, (b) 4 × 4, (c) 5 × 10, (d) 6 × 7, (e) 9 × 6, (f) 11 × 7

Exercise 3.
In each of the questions below, a division is written in decimal form. In each case, convert both
numbers to binary form, perform the division in binary form and check that the solution is
correct by converting the answer to decimal form. (Click on the green letters for solutions.)
(a) 6 ÷ 2, (b) 8 ÷ 2, (c) 9 ÷ 3, (d) 10 ÷ 4, (e) 21 ÷ 7, (f) 18 ÷ 8.

This topic and others are available on www.dzplacide.overblog.com in PDF format


Topic: Number Systems & Binary arithmetic 15 By DZEUGANG Placide

Exercise 4.
1) Using Sign and magnitude, what range of integer can be stored using 6 bits, 8 bits, 16
bits.
2) Using 6 bits, give the sign and magnitude representation of 14, -15, 31, -17
3) Using 6 bits, give the two complement representation of: 15, -28, 31, -1

Exercise 5.
1) What is the BCD representation of (a) 215 (b) -215 (c) 2001
2) What numbers are represented by the following bit strings assume that when there is a
sign, it is represented by the first 4 bits with the convention 1010 for + and 1011 for -.
(a) 10101100100110111 (c) 1001100000000010
(b) 10110011011110010100 (d) 1010010101011011

Exercise 6.
(a) What is the lowest possible value for an 8-bit signed magnitude binary number?
(b) What is the highest possible value for a 10-bit 2's complement binary number?

Exercise 7.
1) Convert each of the following decimal values to 8-bit 2's complement binary.
a) 5410 b) –4910 c) –12810 d) –6610 e) –9810
2) Convert each of the following 8-bit 2's complement binary numbers to decimal.
a) 100111012 b) 000101012 c) 111001102 d) 011010012

Exercise 8.
1) Convert each of the following decimal values to 8-bit signed magnitude binary.
a) 5410 b) –4910 c) –12710 d) –6610 e) –9810
2) Convert each of the following 8-bit signed magnitude binary numbers to decimal.
a) 100111012 b) 000101012 c) 111001102 d) 011010012

Exercise 9.
Using 1’s and 2’s complements perform the following subtractions
a. 100110 – 11011 c. 1101010 – 110100
b. 10011.1101 – 101.11 d. 1010 - 11011

Exercise 10.
Find the following differences using 2’s complement arithmetic. First convert decimal values
to corresponding binary values. Next, find the two’s complement representation of the
subtrahend. Add the minuend and 2’s complemented subtrahend. Check your answers.
a) 12 – 6 b) 4 – 6 c) 3.125 – 6.5 d) 67.25 – 83.125

This topic and others are available on www.dzplacide.overblog.com in PDF format

You might also like