2. All data in a computer is
represented using a number
system. But what is a number
system?
2
3. A number system is a way to represent data. The most common one is the Decimal
Number System. But there exists other forms such as the Binary System, Octal System,
Hexadecimal System etc. Each number system is uniquely identifiable using the Base. The
Base defines which number system is being used to represent the data.
3
4. Data can always be transformed from
one number system to the other by
using the base.
4
16. The binary number system
is used for representing
data in a computer. Thus, a
computer can only
understand 0 and 1.
16
17. Inside a computer, all data
is a stream of 0’s and 1’s.
Thus, a question arises,
how to represent negative
numbers?
17
18. To represent negative numbers, one’s complement method is used. The
ones' complement of a binary number is defined as the value obtained by
inverting all the bits in the binary representation of the number. The ones'
complement of the number then behaves like the negative of the original
number in some arithmetic operations.
ONE’s COMPLEMENT
18
19. However, One’s Complement does suffer from a drawback. Representation
of 0. In One’s complement form, 0 has two representations for +0 and -0 as
illustrated below.
ONE’s COMPLEMENT
For example:
+0 = 0000 0000
-0 = 1111 1111
To mitigate such issues, Two’s Complement is used to represent negative
numbers.
19
20. The problems of multiple
representations of 0 is
circumvented by a system
called two's complement.
In two's complement,
negative numbers are
represented by the bit
pattern which is one
greater than the ones'
complement of the positive
value.
TWO’s COMPLEMENT
20
21. But how is the logic
incorporated in the
computer?
21
22. A logic gate is an elementary building block of a digital circuit. Most logic
gates have two inputs and one output. At any given moment, every
terminal is in one of the two binary conditions low (0) or high (1), represented
by different voltage levels. The logic state of a terminal can, and generally
does, change often, as the circuit processes data. In most logic gates, the
low state is approximately zero volts (0 V), while the high state is
approximately five volts positive (+5 V).
There are seven basic logic gates: AND, OR, XOR, NOT.
Logic Gates
22
28. A universal logic gate is a logic gate that can be used to construct all other
logic gates. There are two primary Universal Gates: NAND and NOR.
In practice, this is advantageous since NAND and NOR gates are
economical and easier to fabricate and are the basic gates used in all IC
digital logic families.
Universal Gates
28