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

Module 2 Number System and Data Representation

Computer Fundamentals and Programming
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
66 views

Module 2 Number System and Data Representation

Computer Fundamentals and Programming
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 30

ES106A:

COMPUTER
FUNDAMENTALS AND
PROGRAMMING
NUMBER SYSTEMS AND
DATA REPRESENTATION
INTRODUCTION

• The organization of any computer depends considerably


on how it represents numbers, characters, and control
information. This lesson describes the various ways in
which computers can store and manipulate numbers
and characters.

• A digital computer manipulates discrete elements of


data and these elements are represented in the binary
forms. Data processing is carried out by means of binary
logic elements using binary signals. Quantities are stored
in binary storage elements.
OBJECTIVES/
INTENDED LEARNING OUTCOMES

At the end of the lesson, students will be able to:


• Know the different Number Systems used in digital electronics.
• Master the conversion of one Number System to another.
• Solve binary arithmetic.
INTRODUCTION TO NUMBER SYSTEM

Data Representation refers to the form in which data is stored, processed,


and transmitted. Devices such as smartphones, iPods, and computers
store data in digital formats that can be handled by electronic circuitry.

The 0s and 1s used to represent digital data are referred to as binary digits
— from this term we get the word bit that stands for binary digit. A bit is a 0
or 1 used in the digital representation of data.
BITS AND BYTES

• All of the data stored and transmitted by digital devices is encoded as


bits. Terminology related to bits and bytes is extensively used to
describe storage capacity and network access speed.

• The word bit, an abbreviation for binary digit, can be further


abbreviated as a lowercase b. A group of eight bits is called a byte and
is usually abbreviated as an uppercase B.
BITS AND BYTES

• When reading about digital devices, you’ll frequently encounter references


such as 90 kilobits per second, 1.44 megabytes, 2.8 gigahertz, and 2 terabytes.
• These Kilo, mega, giga, tera, and similar terms are used to quantify digital

data.
Bit One binary digit Gigabit 230 bits
Byte 8 bits Gigabyte 230 bytes
Kilobit 1,024 bits Terabyte 240 bytes
Kilobyte 1,024 bytes Petabyte 250 bytes
Megabit 1,048,576 bits Exabyte 260 bytes
Megabyte 1,048,576 bytes
BITS AND BYTES

• Bits is use for data rates such as internet connection speeds, or movie
download speed.

• Bytes is use for file sizes and storage capacities.

Example:
• 104KB - read as 104 Kilobyte (KB or KByte), is often used when referring to the size
of a small computer files.
• 56Kbps - read as 56 Kilobits per second (Kb or Kbit), is often used for slow data
rates. Such as 56Kbps dial-up connection.
• 16GB - read as 16 Gigabyte (GB or GByte), is commonly used to refer to storage
capacity. Such as 16GB of Flash Drive.
• 100Gbit - read as 100 Gigabit (Gb or Gbit), is used for really fast network speeds.
NUMBER SYSTEM

A number system is defined as the representation of numbers by using digits or


other symbols in a consistent manner. The value of any digit in a number can be
determined by a digit, its position in the number, and the base of the number
system. The numbers are represented in a unique manner and allow us to operate
arithmetic operations like addition, subtraction, and division.
Example :
Position 3 2 1 0 -1 -2 Base
1234.568
Digits 1 2 3 4 . 5 6 8

Ndecimal = digit * baseposition = 4*80 = 4 (now in decimal form)


TYPES OF NUMBER SYSTEMS

1.Decimal Number System - (Base 10)


2.Binary Number System - (Base 2)
3.Octal Number System - (Base 8)
4.Hexadecimal Number System - (Base 16)
DECIMAL NUMBER SYSTEM

• The decimal number system uses ten digits: 0,1,2,3,4,5,6,7,8 and 9 with the base
or radix of 10. The decimal number system is the system that we generally use to
represent numbers in real life. If any number is represented without a base, it
means that its base is 10.
• Any positive integer N, represented in the decimal system as a string of decimal
digits, may also be expressed as a sum of powers of 10, with each power
weighted by a digit.
DECIMAL NUMBER SYSTEM

• Any fractional value M, represented in the decimal system by a string of decimal


digits together with an embedded decimal point, may also be expressed in
expanded notation by using negative powers of 10.
BINARY NUMBER SYSTEM

• Binary has only two values: 0 and 1. The base or radix of this number system is 2.
Digits 0 and 1 are called bits and 8 bits together make a byte. The data in
computers is stored in terms of bits and bytes. The binary number system does not
deal with other numbers such as 2,3,4,5 and so on.
• The place values in the binary system are the powers of the base b=2, just as the
place values in the decimal systems are the powers of ten. Specifically, the place
values of the integral part of a binary number are the non-negative powers of two:
OCTAL NUMBER SYSTEM

• It has 8 independent values/symbols: 0,1,2,3,4,5,6 and 7. Octal Number System has


a base or radix of 8. Since 8 = 23 , each octal digit has a unique 3-bit binary
representation, as shown below:
HEXADECIMAL NUMBER SYSTEM

• The base or radix of this number system is 16. The symbols used are 0, 1, 2, 3, 4, 5, 6,
7, 8, 9 and 10 to 15 are written as A, B, C, D, E, F respectively. Since 16 = 24 , each
hexadecimal digit has a unique 4-bit binary representation.
NUMBER SYSTEM CONVERSION

❖  BINARY TO DECIMAL
• Any binary number can be written in expanded notation as the sum of each digit
times that digit's place value.

• Since each power of two is weighted by either 0 or 1, the binary number is simply
the sum of those place values in which the bit 1 appears. This sum at once gives us
the decimal equivalent of the binary number.

For example: Convert 1101012 to Decimal


Solution;
NUMBER SYSTEM CONVERSION

❖ DECIMAL TO BINARY
• To convert decimal number to its binary equivalent, we use succesive division.
Divide each succesive quotient by 2, noting the remainders, and stop until we
reach a quotient of 0. The sequence of remainders from the bottom to up, as
indicated by the arrow, yields the required binary equivalent.

For Example: Convert 5310 to Binary


Solution;
NUMBER SYSTEM CONVERSION

❖ BINARY TO OCTAL
• To convert a binary number to octal, we partition the binary number into groups of
three bits, start from the ones digit and proceed to the left. If the number of bits is
less than 3 in the last group, we add zeros to the left.

For example: convert (10111101011)2 into Octal


Solution;
NUMBER SYSTEM CONVERSION

❖ OCTAL TO BINARY
• To convert an octal number to binary, we write 3 bit binary equivalent to each
octal digit in the same order.

For example: Convert 27538 to binary

Solution;
NUMBER SYSTEM CONVERSION

❖ BINARY TO HEXADECIMAL
• To convert a binary number to hexadecimal, we partition the binary number into
groups of four bits, start from the ones digit and proceed to the left. If the number of
bits is less than 4 in the last group, we add zeros to the left.

For example: convert (1011011011)2 into Hexadecimal


Solution;
NUMBER SYSTEM CONVERSION

❖ HEXADECIMAL TO BINARY
• To convert an Hexadecimal number to binary, we write 4 bit binary equivalent to
each hexadecimal digit in the same order.

For example: Convert 2DB16 to binary


Solution;
NUMBER SYSTEM CONVERSION

❖ DECIMAL TO OCTAL
• To convert a given decimal integer number to octal, successively divide the given
number by 8 till the quotient is 0, noting the remainders. The sequence of
remainders from the bottom to up, as indicated by the arrow, yields the required
octal equivalent.
For example: convert (378)10 into octal.
Solution;
NUMBER SYSTEM CONVERSION

❖ OCTAL TO DECIMAL
• For conversion octal to decimal number, multiply each digit in the octal number by
the weight of its position and add all the product terms.

For example: convert (572)8 into decimal.


Solution;
NUMBER SYSTEM CONVERSION

❖ DECIMAL TO HEXADECIMAL
• To convert a given decimal number to hexadecimal, successively divide the given
number by 16 till the quotient is 0, noting the remainders. The sequence of
remainders from the bottom to up, as indicated by the arrow, yields the required
hexadecimal equivalent

For example: convert (2598)10 into hexadecimal.


Solution;
NUMBER SYSTEM CONVERSION

❖ OCTAL TO HEXADECIMAL
• For conversion of octal to Hexadecimal, first convert the given octal number to
binary and then binary number to hexadecimal.
For example: convert (756)8 into hexadecimal.
Solution;
NUMBER SYSTEM CONVERSION

❖ HEXADECIMAL TO OCTAL
• For conversion of hexadecimal to octal, first convert the given hexadecimal
number to binary and then binary number to octal.
For example: convert s (1EE)16 into OCTAL.
Solution;
BINARY ARITHMETIC

❖ BINARY ADDITION
BINARY ARITHMETIC

❖ BINARY SUBTRACTION
• For subtraction in the decimal system, normally the borrow method is used.
BINARY ARITHMETIC

❖ BINARY MULTIPLICATION
• Binary multiplication uses the same techniques as decimal multiplication. In fact,
binary multiplication is much easier because each multiplying digit is either zero or
one.

RULES:
When performing binary multiplication, remember the following rules;
1. Copy the multiplicand when the multiplier digit is 1. Otherwise, write a row of zeros.
2. Shift the results one column to the left for a new multiplier digit.
3. Add the results using binary addition to find the product.
BINARY ARITHMETIC

❖ BINARY DIVISION
• Division of binary numbers uses the same technique as division in
the decimal system.

RULES
When doing binary division, some important rules need to be remembered;
1. When the remainder is greater than or equal to the divisor, write a 1 in the
quotient and subtract.
2. When the remainder is less than the divisor, write a 0 in the quotient and
add another digit from the dividend.
3. If all the digits of the dividend have been considered and there is still a
remainder, mark a radix point in the dividend and append a zero.
Nothing is impossible. The
word itself says ‘I’m possible!'
— Audrey Hepburn

You might also like