0% found this document useful (1 vote)
121 views27 pages

Introduction To Microprocessor Systems: Basic of Digital Electronics

This document provides an introduction to basic digital electronics concepts used in microprocessor systems. It discusses binary language and logic, digital devices, data types, number systems including binary, octal, hexadecimal and decimal. It also covers topics like addition, subtraction, conversion between number systems, signed and unsigned numbers in two's complement form, and character storage using ASCII encoding.

Uploaded by

shimzah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (1 vote)
121 views27 pages

Introduction To Microprocessor Systems: Basic of Digital Electronics

This document provides an introduction to basic digital electronics concepts used in microprocessor systems. It discusses binary language and logic, digital devices, data types, number systems including binary, octal, hexadecimal and decimal. It also covers topics like addition, subtraction, conversion between number systems, signed and unsigned numbers in two's complement form, and character storage using ASCII encoding.

Uploaded by

shimzah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 27

Introduction to Microprocessor

Systems

Basic of Digital Electronics

Prepared By: Noman Ahmed

1
Digital Electronics

Binary Language & Logic


Binary Number
Data types
Number System
Signed & Unsigned number
Sequential & Combinational circuit

2
Digital Devices
Most computers today are composed of digital
devices.
Process electrical signals.
Can only have two states.

States are:
A high level of voltage: 5V DC
A low level of voltage: 0V DC

3
Digital Devices
PCs are digital electronic systems.
PCs process data in digital format.

What a Digital Computer Understands:


Computer is a digital electronic device, so it
recognizes high voltage levels (1, or 5V DC), and
low voltage levels (0, or 0V DC).

4
BINARY LANGUAGE AND LOGIC

Logic values used in computer corresponds


to binary, Base-2 number system.
Uses two values, 0 and 1.
Binary digit is referred to as a bit.
Representing information using bits:
Very little can be conveyed by a single bit. True
or false can be conveyed.

5
Two bits can represent 22 = 4 different
combinations.
Any number, letter, or symbol can be
described by organizing a group of related
bits into coded bit patterns called words.
A bit is a basic unit of information.
A nibble is a group of 4 bits and can
represent 16 things.
A byte is a group of 8 bits and can represent
256 things.

6
Binary Numbers

Digital computers store information in binary


Binary allows two states
On yes true 1
Off no false 0
Each digit in a binary number is called a bit

0 1 1 0
bit
0ff on on off

7
Data types

byte: 8 bits:
10010101
word: 16 bits or __
2 bytes:
1110101101100010
double word: 32 4 bytes :
__ bits or __
11010110111001011101011011001011
quad word: 64 8 bytes:
__ bits or __
01011110110101011101010011001011
11110110110001011101011011001101
8
Range of a unsigned number

Question: What is the range of numbers that


can be represented with ?

1 bit? 0 ~ 1 2 1
1

2 bits? 0 ~ 3 2 1
2

4 bits? 0 ~ 15 2 1 4

n bit? 0 ~ ( 2 1) n

9
Range of the data types

Unsigned integers:
byte: 0 to 28 - 1 = 255
word: 0 to 216 - 1 = 64k - 1 = 65,535
double word: 0 to 232 - 1
quad word: 0 to 264 - 1

10
Numbering Systems

A number system of base n is a system that


uses distinct symbols for n digits

11
Numbering Systems

A written number is meaningful only with


respect to a base

To tell the assembler which base we use:


Hexadecimal 25 is written as 25h
Octal 25 is written as 25o or 25q
Binary 1010 is written as 1010b
Decimal 1010 is written as 1010 or 1010d

12
Number systems (bases)

Number systems used


Binary: The internal representation inside
the computer. They may be represented in
binary, octal, or hexadecimal.
Decimal: The system people use.
ASCII representations of numbers used for I/O:
ASCII binary
ASCII octal
ASCII decimal
ASCII hexadecimal

13
Number systems (bases) Example

Format Value

ASCII binary "01000001"

ASCII decimal "65"

ASCII hexadecimal "41"

ASCII octal "101"

14
Addition & Multiplication
Examples:
1001100b 1110b
+ 1101011b * 1101b
10110111 10110110
10110101b 111101b
+ 1101101b * 1111b
100100010 1110010011

15
Converting to decimal
Binary to Decimal
1010b =1 * 23 + 0 * 22 + 1 * 21 + 0*100
=10

Hex to Decimal
ABCh = 10 * 162 + 11 * 161+ 12 * 160
= 10 * 256 + 11 * 16 + 12 * 1
= 2560 + 176 + 12
= 2748

16
Converting to decimal

Octal to Decimal
256o = 2 * 82 + 5 * 81+ 6 * 80 =174

Conclusion:
(Number)n
= (multiply each digit by an integer power of n)

17
Conversion from decimal
Decimal integer to Binary
quotient remainder
54 = 27 * 2+ 0
27 = 13 * 2 + 1
13 = 6 * 2 +1
6=3*2+0
3=1*2+1
1=0*2+1

110110 18
Conversion from decimal

Decimal integer to Hex :


54= 3 * 16 + 6
3 = 0 * 16 + 3
Decimal integer to octal
36h
54 = 6 * 8+ 6
6= 0*8+6

66o
19
Conversion from decimal
Decimal fraction to Binary (Octal, Hex)
integer
(0. 6 8 7 5)10 = (0.1011)2
X 2
1.3750
X 2
0.7500
X 2
1.5000
X 2
1.0000
0.1 0 1 1 20
Signed numbers
Signed numbers: The number of bits must be
fixed. In every case, the highest bit is the
sign bit.
0 means +

1 means -

Example:

Unsigned number: 1101b = 13


Signed number: 1101b = ?
21
Twos complement

- 3d = 1101 b (signed binary number)


0010 b (reverse all bits)
+ 1 Ones complement
0011 b (unsigned value = 3)
reversible Twos complement

twos complement of n = NOT(n) +1

22
Range of signed numbers
Two's complement: Sizes
Signed byte: -128 to +127 = 27 - 1
Signed word: -32,768 to +32,767 = 215 - 1
Singed double word:
-2,147,483,648 to +2,147,483,647 = 231 - 1
Comments:
There is one more negative than positive value
There are (about) half as many positive signed
values as unsigned values
23
Addition & Subtraction (signed)

Algorithm to add in signed decimal


(sign and magnitude)
If both numbers have the same sign
Add the two magnitudes
Prefix with the common sign
else
Subtract the number with smaller magnitude
from the number with the larger magnitude
Prefix with the sign of the number with the
larger magnitude.

24
Addition & Subtraction (signed)
Two's complement:
Addition
1) add two numbers including their sign bits

2) discard any carry out of the sign position

Example:

+6 00000110 -6 11111010
+ 13 0 0 0 0 1 1 0 1 - 13 1 1 1 1 0 0 1 1
+ 19 0 0 0 1 0 0 1 1 - 19 1 1 1 0 1 1 0 1
25
Addition & Subtraction (signed)

Subtraction

1) Take the 2s complement of the subtrahend


(including the sign bit)
2) Add it to the minuend (including the sign bit)
Example:

6 00000110 13 0 0 0 0 1 1 0 1
- 13 1 1 1 1 0 0 1 1 -6 11111010
-7 11111001 +7 00000111
26
Character Storage

Characters are stored as numbers


Coding schemes
ASCII (7 or 8 bit)
EBCDIC (8 bit)
Unicode (16 bit)
ASCII Examples:
A = 65d = 41h a = 97d = 61h
B = 66d = 42h b = 98d = 62h
0 = 48d = 30h 1 = 49d = 31h
= 32d = 20h * = 42d = 2Ah

27

You might also like