Professional Documents
Culture Documents
MMW111 - Group 6: Topics: Integers in Computer Logic and Computer Addition
MMW111 - Group 6: Topics: Integers in Computer Logic and Computer Addition
Topics:
1. Integers in Computer
2. Logic and Computer Addition
Topic Outline
• Binary Integers
▫ Methods in Computing Binary of Integers
Sign bit and Magnitude
1’s and 2’s Compliment
▫ Integer Arithmetic
• Boolean Algebra
▫ Logic (AND, OR, EXOR/XOR)
▫ Theorems, Postulates and Laws
Number System Theory
Numerical System Computer System
• Based on counting using an • States that the meaning of
alphabet and operations. digits must be expanded
• The decimal number system beyond mere counting,
uses the alphabet quantities and values.
{0,1,2,3,4,5,6,7,8,9}, called • Regularly use numeral systems
digits. of bases other than 10. (e.g.
• And the basic operations add, Base 2 (binary), Base 8 (octal),
subtract, multiply and divide. and Base 16 (hexadecimal)
Remember:
• The key to understanding
computers lies in unlearning that
the digit 1 means one and only
one, and learning that the digit 1
identifies something, which may
not be a number at all.
Integers in Computer
Binary Representation
of Integers
Binary Representation of Integers
• Integer is used to refer to any data type which
can represent some subset of the mathematical
integers. These are also known as integral data
types.
Note:
• Binary number can be represented only
by using 0’s and 1’s.
• Cannot use the sign (-) to denote the
negative number or (+) to denote the
positive number.
• Even the decimal point (.) cannot be
used.
Byte
• A byte represents eight bits, and is the most
commonly used term relating to the amount of
information stored within a computer’s
memory. The term doesn’t refer to “eight bits”
in a loose, simply mathematical sense, but to a
specific set of eight bits which operate as a
cohesive unit within a computer system. The
byte was first named in 1956, during the design
of the IBM Stretch computer.
Bit
• A bit is just a smaller unit of information than a
byte. It reflects the basic logical process of a
transistor: a single unit of information reflecting
a zero (no charge) or a one (a completed,
charged circuit). There are eight bits in one byte
of information.
• It is also a distinction between two possible
states, e.g. 0 or 1, high or low, off or on, etc.
Representation of Binary integers
in Computer
1 byte = 8 bits
2 bytes = 16 bits
4 bytes = 32 bits Note: Use hexadecimal to compute
8 bytes = 64 bits
Conversion Table
Decimal Binary Octal Hexadecimal
0 0000 0 0
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
Conversion Table
Decimal Binary Octal Hexadecimal
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
Hexadecimal notation
Hexadecimal Binary Hexadecimal Binary
0 0000 8 1000
1 0001 9 1001
2 0010 A 1010
3 0011 B 1011
4 0100 C 1100
5 0101 D 1101
6 0110 E 1110
7 0111 F 1111
Methods in Computing Binary of
Integers
• Sign and magnitude method
• One’s (1’s) complement method
• Two’s (2’s) complement method
1) Sign and Magnitude Method
16 bits used to represent integers
Most significant bit (Leftmost bit) – indicated sign of
the number
If negativity the leftmost bit is 1
If positivity the leftmost bit is 0
For Example:
1. So, the binary number is (11110). If we take the size
of the word is 1 byte, then the number is 30 will be
represented as
= 00011110
2) One’s Complement Method
• Positive number is represented as same as
the binary number.
• If the number is negative, then we need to
find one’s complement of a binary number
• The one’s complement of a binary number
will replace every 0 with 1 and vice versa
For example:
1. Find the 1-byte integer representation of -55
Ā =C
ō 1
ī 0
End of Presentation
Presented and made by:
Group 6 – PH1Y1-1
Durano
Maglangit
Morden
Rosaldo
Wagan