0% found this document useful (0 votes)
3 views30 pages

Digital System Design - Chapter1

This chapter introduces number systems including decimal, binary, and hexadecimal, along with methods for conversion between these systems. It covers binary arithmetic operations such as addition, subtraction, multiplication, and division, as well as the representation of negative numbers using sign bits and complements. Additionally, it discusses binary coding systems like BCD and ASCII for representing decimal digits and alphanumeric data.

Uploaded by

eaeconteh
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
Download as pptx, pdf, or txt
0% found this document useful (0 votes)
3 views30 pages

Digital System Design - Chapter1

This chapter introduces number systems including decimal, binary, and hexadecimal, along with methods for conversion between these systems. It covers binary arithmetic operations such as addition, subtraction, multiplication, and division, as well as the representation of negative numbers using sign bits and complements. Additionally, it discusses binary coding systems like BCD and ASCII for representing decimal digits and alphanumeric data.

Uploaded by

eaeconteh
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1/ 30

Chapter1--Introduction

Number Systems and


Conversion
This chapter will cover…

 1.1 Digital Systems and Switching Circuits


 1.2 Number Systems and Conversion
 1.3 Binary Arithmetic
 1.4 Representation of Negative Numbers
 1.5 Binary Codes
Number Systems

 Decimal (base 10) numbers


 10 required symbols
 0,1,2,3,4,5,6,7,8,9
 Binary (base 2) numbers
 2 required symbols
 0,1
 Hexadecimal (base 16)
 16 required symbols
 0,1,2…9 A,B,C,D,E,F
Number Systems (2)

 Any positive integer can be chosen as the base of


a number system

N (a4 a3a2 a1a0 a 1a 2 a 3 ) R


a4 R 4  a3 R 3  a2 R 2  a1 R1  a0 R 0
 a 1 R  1  a 2 R  2  a 3 R  3
Conversion

 Conversion of a decimal integer to base R using


the division method

N ( an an  1an  2 ...a1a0 ) R
an R n  an  1 R n  1  ....  a2 R 2  a1 R1  a0
N
an R n  1  an 1 R n  2 ....  a2 R1  a1 Q1 , reminder
remainder a
0
R
Q1
an R n  2  an  1 R n  3 ....  a3 R1  a2 Q2 , reminder
remainder a
1
R
...
 This process is continued until we finally obtain an
Conversion Example----Convert 5310 to binary.
Conversion of a decimal fraction to base R can be done
using successive multiplications of R
Example: Convert .62510 to binary.
Example: Convert 0.710 to binary.
Conversion (2)

 Conversion between two bases other than decimal


can be done directly by using the procedure given
 However, the arithmetic operations would have to be
carried out using a base other than ten
 It is generally easier to convert to decimal first then
convert the decimal number to the new base.
Example: Convert 231.34 to base 7.
Conversion (3)

 Conversion from binary to hexadecimal (and


conversely) can be done by inspection.
 Because each hexadecimal digit corresponds to exactly
four binary digits
Binary  Hexadecimal
Conversion

Conversion from binary to hexadecimal (and conversely) can


be done by inspection because each hexadecimal digit
corresponds to exactly four binary digits (bits).
Binary Arithmetic

 The addition table for binary number is:


0+0=0
0+1=1
1+0=1
1+1=0 and carry 1 to the next column
Add 1310 and 1110 in binary.
Binary Arithmetic

 The subtraction table for binary number is:


0-0=0
0-1=1 and borrow 1 from the next column
1-0=1
1-1=0
EXAMPLES OF BINARY SUBTRACTION:

11101 10000
-10011 - 11
Binary Arithmetic

 The multiplication table for binary number is:


0×0=0
0×1=0
1×0=0
1×1=1
Binary Arithmetic
When doing binary multiplication, a common way to avoid carries
greater than 1 is to add in the partial products one at a time as
illustrated by the following example:

1111 multiplicand
1101 multiplier
1111 1st partial product
0000 2nd partial product
(01111) sum of first two partial products
1111 3rd partial product
(1001011) sum after adding 3rd partial product
1111 4th partial product
11000011 final product (sum after adding 4th
partial product)
Binary Arithmetic

The following example illustrates


division of 14510 by 1110 in binary:
Representation of Negative Numbers

 In most computers, in order to represent both


positive and negative numbers the first bit in a word
is used as a sign bit
 0 used for plus
 1 used for minus
 The sign and magnitude system
 The design of logic circuits to do arithmetic with
sign and magnitude is awkward
The 2’s complement

 Positive numbers
 N is represented by a 0 followed by the magnitude as in
the sign and magnitude system
 Negative numbers
 -N is represented by its 2’s complement N*
 How to calculate the 2’s complement?
 For the word length n bits

N * 2n  N
The 1’s complement

 Negative numbers
 -N is represented by its 1’s complement N
 For the word length n bits

N (2n  1)  N
 The 2’s and 1’s complement

N * N  1

An alternative way to form the 1’s


complement is to simply complement
N bit by bit by replacing 0’s with 1’s
and 1’s with 0’s
2’s Complement Addition (a)
2’s Complement Addition (b)
2’s Complement Addition (c)
Binary Codes

 Although most computers work internally with


binary numbers, the input-output equipment uses
decimal numbers.
 Logical circuits only accept two valued signals
 The decimal numbers must be coded in terms of
binary signals
Binary Codes
 BCD (Binary Coded Decimal) or 8-4-2-1 BCD
 Each decimal digit is replaced by its binary equivalent

 Other sets of binary codes for the ten digits


 Each decimal digit must be represented by a distinct
combination of binary digits
 To translate a decimal number to coded form, each
decimal digit is replaced by its corresponding code
Table 1–2. Binary Codes for Decimal Digits

8-4-2-1
Decimal 6-3-1-1 Excess-3 2-out-of-5 Gray
Code
Digit Code Code Code Code
(BCD)
0 0000 0000 0011 00011 0000
1 0001 0001 0100 00101 0001
2 0010 0011 0101 00110 0011
3 0011 0100 0110 01001 0010
4 0100 0101 0111 01010 0110
5 0101 0111 1000 01100 1110
6 0110 1000 1001 10001 1010
7 0111 1001 1010 10010 1011
8 1000 1011 1011 10100 1001
9 1001 1100 1100 11000 1000
ASCII Code

 American Standard Code for Information Exchange


 Many applications of computers require the processing of
data which contains numbers, letters and other symbols.
 In order to transmit such alphanumeric data to and from a
computer or store it internally in a computer, each symbol
must be represented by a binary code.
 ASCII code is a 7-bit code
Summary

 Different base of number systems


 Conversion
 Add, subtract, multiply and division
 Negative numbers
 Represent a decimal number in different codes
 ASCII code

You might also like