

























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


























Instructor: M. Shahzad Jaffar
Computers are made up of millions of switches
Each switch has two states, “on” or “off”
Thus, binary system is a nature and easiest
way for a computer to represent information
and implement operations
Number system
Any system of representing numbers. Also called
numeral system
The base of any number system is the number of digits
in the system
The number systems most commonly used in
are:
Formula: ∑DIGIT * 2
Octal - base 8 number system
Hexadecimal - base 16 number system
E.g., (for example)
Binar
y
Octal Decima
l
Hexa-
decimal
Convert a positive decimal
integer to binary using
repeated division
Step 1 - divide the value by two
and record the remainder
Step 2 - continue to divide the
quotient by two and record the
remainder, until the newest
quotient becomes zero
Step 3 - the binary
representation is the remainders
listed from bottom to top in the
order they were recorded
E.g., what's the
binary for
integer 13?
13 ÷ 2 = 6 ··· 1
6 ÷ 2 = 3 ··· 0
3 ÷ 2 = 1 ··· 1
1 ÷ 2 = 0 ··· 1
Quotient
Reminder
Divisor
Dividend
Exercise: Real Numbers to
Binary
A real number is a number that has a decimal
point (called floating point number in
computing languages)
Convert decimal 13.375 to binary:
13 = 1101
0.375 = 0.
13.375 = 1101.
More examples:
133.3 =?
Standardize the representation of real
numbers
Standardize Real Number
Representation
Normalized representation of real numbers:
4; -0.0034 -3.4 x 10-
101.01 1.0101x22; -0.00101 - 1.01x2-
Instructor: M. Shahzad Jaffar
Rules of Binary
Multiplication
0 0 1 0 1 0 0 1 (
10 )
x 0 0 0 0 0 1 1 0 (6 10 )
0 0 0 0 0 0 0 0
0 0 1 0 1 0 0 1
0 0 1 0 1 0 0 1
0 0 1 1 1 1 0 1 1 0 (246 1 0
)
Binary Division:
repeated process of
subtraction
1 1 0 1 1 (
1 0
)
1 0 1 ) 1 0 0 0 0 1 1 1 (135 10 )
(5 10 ) - 1 0 1
1 1 0
- 1 0 1
0 1 1
- 0
1 1 1
- 1 0 1
1 0 1
- 1 0 1
Bytes Representing Signed
Integers
1's complement
representation for signed integers
Designed to simplify the binary arithmetic, allowing the
computer to perform all arithmetic operations using only
addition
The 1's complement of a number is found by changing all
1's to 0's and all 0's to 1's. This is called as taking
complement or 1's complement. Example of 1's
Complement is as follows.
2’s
complement:-
Example:
Convert binary number
111001101 to 2’s
complement
Method
2’s complement of a
binary no can be
obtained by two step
process
Step 1
Step 2
Answer
Instructor: M. Shahzad Jaffar
2’s complement:-
Each character (letter,
punctuation, etc.) is
assigned a unique binary
number
ASCII - American Standard
Code for Information
Exchange (primarily for
English)
Unicode : represent the major
symbols used in languages
world side
E.g.,
For more help
A monitors screen is
divided into a grid of
small unit called pixels
The more pixels per inch,
the better the resolution ,
the sharper the image
All colors on the screen
are a combination of red,
green and blue (RGB),
just at various intensities
“True color” systems
require 3 bytes or 24 bits
per pixel