CH-1 Number System
CH-1 Number System
Synthesis
EC9040
Department of Computer Engineering,
Faculty of Engineering
University of Jaffna.
References
• M. Morris Mano, and Michael D. Ciletti, Digital
Design with an Introduction to Verilog HDL,
VHDL, and System Verilog, sixth edition,
Pearson.
• Wayne Wolf, FPGA-Based System Design,
Prentice Hall.
Introduction to Digital Logic
• Digital systems.
• Number systems.
General way of representation
Number base conversion.
Octal and hexadecimal numbers.
Introduction to Digital Logic (Cont’d)
• Complement of a number.
• Signed binary number.
• Binary codes
• Binary logic
• Field Effect Transistors
Digital Systems
• Present age of technology is referred to as digital age.
• Digital systems are used in
• communication
• business transaction
• traffic control
• space craft guidance
• medical treatment
• weather monitoring and etc.
Digital Systems
• Discrete elements of information can be represented by group
of binary digits called binary codes.
• Either can be emerged from
– a processed data or
– quantized from continuous signals.
• Example
A general purpose digital computer that contains
– A memory unit
– A central processing unit
– I/O units.
Other Digital Systems
• Special purpose digital computers .
• Used to represent and manipulate discrete elements of
information.
Digital Systems (cont’d)
Most of commercial devices are made of digital circuits.
• They are programmable.
• Same type of hardware can be used for different
applications.
• Advances in Integrated Circuit technology.
• Performs at very high speed.
100 Millions of operations per second.
• Can operate with high reliability .
Error correction codes.
Number systems
6738
Base
• Radix of
• Binary: 2 (0,1)
• Decimal: 10 (0,1,2,3,4,5,6,7,8,9)
• Octal: 8 (0,1,2,3,4,5,6,7)
• Hex: 16 (0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F)
• Exercise:
• Convert 11010012 to decimal
• Convert 0.10112 to decimal
• Convert 10101.1012 to decimal
Octal and Hexadecimal Number
Systems
• An octal digit corresponds to 3 binary digits.
• A hexadecimal digit corresponds to 4 binary digits.
• Binary to octal conversion.
10 110 001 101 011 . 111 100 000 1102 = 26153.74068
• Binary to hexadecimal conversion.
10 1100 0110 1011 . 1111 00102 = 2C6B.F216
Base Conversion of Number System.
Number systems can be represented in different radixes.
Exercise
1. Convert 2310 to binary.
2. Convert 32110 to octal.
3. Convert 0.687510 to binary.
4. Convert 0.687510 to octal.
5. Convert 41.687510 to binary and 153.51310 to octal.
6. Convert 673.1248, and 306.D16 to Binary.
Arithmetic Operations of Number
System.
Follows the same rules as decimal numbers.
• Example: If r =2,
Subtraction
Minuend 101101
Subtrahend 100111
Addition
Difference
Augend 101101
Multiplication
Addend 100111
Multiplicand 1011
Sum
Multiplier 101
Product
Complement of a Number
• Complements of a number are used to simplify Arithmetic
operation.
Example: Subtraction
• There are two types of complement of a number.
– r‘s complement or radix complement
– (r-1)’s complement or diminished radix complement
Radix Complement
• Defined as
− rn – N, for N ≠ 0 and
10 pow(n) -N
− 0, for N = 0.
− Where, N- given number, and n- no. of bits.
− r-radix
2 pow(n) -N
Diminished Radix Complement
• Defined as,
− (rn - 1) – N.
− Where, N – the Number.
• 9’s complement of 012398
(rn - 1) – N = 999999 – 012398 = 987601
• 1’s complement of a number
- Obtained by subtracting each digit from 1.
- 1’s complement of 0101101 is 1010010.
2 pow(n)-1 -N
Signed Binary Numbers
Signed & Magnitude Conversion.
• Need to represent signed and unsigned numbers by a string of
bits in computers.
• If it is a signed number , then the leftmost bit may represent the
sign.
Signed Binary Numbers
Signed & Magnitude Conversion (cont’d)
• If it is an unsigned number, then the left most bit is the MSB of
the number.
• Example
11001 represents,
– 25, for unsigned representation.
– -9, for signed representation.
Signed Binary Numbers (cont’d)
Signed & Complement System
A different system called Signed & Complement System is also
widely used.
• The signed & complement system uses complement of a
number to negates it.
- Either 1’s complement or 2’s complement can be used.
- 2’s complement is most commonly used.
Example
• +9 is represented as,
00001001 (signed & magnitude)
• -9 is represented as,
• 10001001 (signed-magnitude)
• 11110110 (signed-1’s compliment)
• 11110111 (signed-2’s compliment)
Comparison between Different Signed
Binary Numbers
Decimal 2’s Complement 1’s Complement Signed &
(Signed) (signed) Magnitude
+4 0100 0100 0100
+3 0011 0011 0011
+2 0010 0010 0010
+1 0001 0001 0001
0 - 1111 1000
-1 1111 1110 1001
-2 1110 1101 1010
-3 1101 1100 1011
-4 1100 1011 1100
Arithmetic Addition
1. If there are any negative numbers (addend or augend) then
convert them into 2’s complement.
2. Add the two numbers, including sign-bit position.
3. Discard carry-out of the sign-bit position (if any).
Example