Nothing Special   »   [go: up one dir, main page]

Unit 2: Number System

You are on page 1of 15

UNIT 2:

NUMBER SYSTEM:
NON-POSITIONAL NUMBER SYSTEM:
A positional number system is one in which
a digit’s value depends on its where it occurs in the
representation. Our usual decimal system is
positional.
A non-positional number system is anything
else. Tally marks are a common example:

The Roman numeral system is an interesting


mix of positional and non-positional systems. For
example, we are usually taught that I=1,V=5,X=10,
etc. However, if that were true, all of these would
represent the same number:
XVI
XIV
VIX
But in fact the first two represent different numbers
(16 and 14 respectively), and the third does not
represent any number.
POSITIONAL NUMBER SYSTEM:
A positional (numeral) system is a system for
representation of numbers by an ordered set of
numerals symbols (called digits) in which the value of
a numeral symbol depends on its position.
For each position a unique symbol or a limited
set of symbols is used.
BINARY CODES:
In the coding, when numbers, letters or words
are represented by a specific group of symbols, it is
said that the number, letter or word is being
encoded.
The group of symbols is called as a code.
1. Advantages of Binary Code:
2. Following is the list of advantages that binary
code offers.
3. Binary codes are suitable for the computer
applications.
4. Binary codes are suitable for the digital
communications.
5. Since only 0 & 1 are being used,
implementation becomes easy.
Classification of binary codes:
The codes are broadly categorized into
following four categories.
6. Weighted Codes
7. Non-Weighted Codes
8. Binary Coded Decimal Code
9. Alphanumeric Codes
10. Error Detecting Codes
11. Error Correcting Codes.
OCTAL CODES:
The octal numeral system, or oct for short, is the
base-8 number system, and uses the digits 0 to 7.
Octal numerals can be made from binary
numerals by grouping consecutive binary digits into
groups of three (starting from the right).
For example, the binary representation for
decimal 74 is 1001010. Two zeroes can be added at
the left: (00)1 001 010, corresponding the octal digits
1 1 2, yielding the octal representation 112.
In the decimal system each decimal place is a
power of ten.
Binary Coded Decimal (BCD) code:
In this code each decimal digit is represented by
a 4-bit binary number.
BCD is a way to express each of the decimal
digits with a binary code.
In the BCD, with four bits we can represent
sixteen numbers (0000 to 1111). But in BCD code
only first ten of these are used (0000 to 1001).
The remaining six code combinations i.e. 1010
to 1111 are invalid in BCD.
Advantages of BCD Codes:
·1 It is very similar to decimal system.
·2 We need to remember binary equivalent of
decimal numbers 0 to 9 only.
·3 Disadvantages of BCD Codes
·4 The addition and subtraction of BCD have
different rules.
·5 The BCD arithmetic is little more complicated.
·6 BCD needs more number of bits than binary to
represent the decimal number. So BCD is less
efficient than binary.
EBCDIC:
Extended Binary Coded Decimal Interchange
Code
It is a binary code for alphabetic and numeric
characters that IBM developed for its larger
operating systems.
It used for legacy applications and databases.
In an EBCDIC file, each alphabetic or numeric
character is represented with an 8-bit binary number
(a string of eight 0's or 1's).
256 possible characters (letters of the alphabet,
numerals, and special characters) are defined.
ASCII:
ASCII Stands for American Standard Code for
Information Interchange
This is a standard set of characters understood
by all computers.
It consisting mostly of letters and numbers.
ASCII makes it relatively easy to exchange
information between different programs, different
operating systems, and even different computers.

For example, if we look at table, we find that


the decimal digit 9 when represented in 8421 BCD is
1001. Now the decimal digit assigned to first 1 is 8
and to the second 1 is 1. If we add 8 and 1 we get the
required decimal number which is 9.
COMPLEMENT ARITHMETIC:
Complements are used in the digital computers
in order to simplify the subtraction operation and for
the logical manipulations.
Binary system complements:
As the binary system has base r = 2. So the
two types of complements for the binary system are
2's complement and 1's complement.
1's complement:

2's complement:

Binary arithmetic:
Binary arithmetic is essential part of all the digital
computers and many other digital system.
Binary Addition:
Ex:

Binary Subtraction:

Ex:

Binary Multiplication:
Binary multiplication is similar to decimal
multiplication.
Ex:

Binary Division:
Binary division is similar to decimal division. It is
called as the long division procedure.
ex:
Logic gates:
Logic gates are the basic building blocks of any
digital system.
It is an electronic circuit having one or more than
one input and only one output.
The relationship between the input and the
output is based on a certain logic.
AND Gate
A circuit which performs an AND operation is
shown in figure.
Logic diagram:

OR Gate:
A circuit which performs an OR operation .
Logic diagram:
NOT Gate:
NOT gate is also known as Inverter. It has one
input A and one output Y.
Logic diagram

NAND Gate:
A NOT-AND operation is known as NAND
operation. It has n input (n >= 2) and one output.
Logic diagram:
XOR Gate:
XOR or Ex-OR gate is a special type of gate.
It can be used in the half adder, full adder and
subtractor.
Logic diagram:

Half adder:
A half adder is a type of adder, an electronic
circuit that performs the addition of numbers.
The half adder is able to add two single binary
digits and provide the output plus a carry value.
It has two inputs, called A and B, and two outputs S
(sum) and C (carry).
Full Adder:
A full adder is a digital circuit that performs
addition.
Full adders are implemented with logic gates in
hardware.
The adder outputs two numbers, a sum and a
carry bit.
The term is contrasted with a half adder, which
adds two binary digits.
:

You might also like