You are on page 1of 39

315 CNET-3

Microprocessor &
Assembly Language

CNET 315 Microprocessor &


Assembly Language
Phiros Mansur Nalakath
Course Coordinator, MPAL
Dept. of Computer & Network Engineering
College of Computer Science and Information Technology
Jazan University, Jazan, KSA.
Chapter 1
Computer Number Systems
& Digital Devices

CNET 315 Microprocessor &


Assembly Language
2
Objectives
➢ To understand the basic number systems
used in Computers.

CNET 315 Microprocessor &


Assembly Language
➢ To study Conversions between the major
number systems
➢ To understand fundamentals of devices
like Latches, Flip Flops, Registers, RAM,
ROM and ALU etc.
Number Systems
Number Used by Used in
System Base Symbols humans? computers?

Decimal 10 0, 1, … 9 Yes No

CNET 315 Microprocessor &


Assembly Language
Binary 2 0, 1 No Yes

Hexa- 16 0, 1, … 9, No No
decimal A, B, … F

4
Base
Quick Example

2510 = 110012 = 1916

CNET 315 Microprocessor &


5

Assembly Language
Weight

12510 => 5 x 10 0 = 5
2 x 10 1 = 20
1 x 10 2 = 100

CNET 315 Microprocessor &


Assembly Language
125

Base

6
Quantities/Counting (1 of 3)
Hexa-
Decimal Binary decimal
0 0 0
1 1 1

CNET 315 Microprocessor &


Assembly Language
2 10 2
3 11 3
4 100 4
5 101 5
6 110 6
7 111 7 7
Quantities/Counting (2 of 3)
Hexa-
Decimal Binary decimal
8 1000 8
9 1001 9

CNET 315 Microprocessor &


Assembly Language
10 1010 A
11 1011 B
12 1100 C
13 1101 D
14 1110 E
15 1111 F 8
Quantities/Counting (3 of 3)
Hexa-
Decimal Binary decimal
16 10000 10
17 10001 11

CNET 315 Microprocessor &


Assembly Language
18 10010 12
19 10011 13
20 10100 14
21 10101 15
22 10110 16
23 10111 17 9
Binary Number System

• Binary Number System has base 2.


• It uses the digits 0 and 1 only
• Example : 101011

CNET 315 Microprocessor &


Assembly Language
10
Binary Addition
Addition - Example
Binary Subtraction

9/15/09 - L15 Decoders,


● Just like subtraction in any other base

Multiplexers
◦ Minuend 10110
◦ Subtrahend - 10010
◦ Difference 00100

DeGroat, ECE, OSU


Copyright 2009 - Joanne
● And when a borrow is needed. Note that the borrow
gives us 2 in the current bit position.

.
13
Hexadecimal (Hex)
Numbering System

• Base: 16
• Digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F

■ Hexadecimal number: 1F416

= (1 x 16 2 ) + (F x 16 1) + (4 x 160)
Hexadecimal (Hex)
Extra Digits

Decimal ValueHexadecimal Digit


10 A
11 B
12 C
13 D
14 E
15 F
Hexadecimal Addition

CNET 315 Microprocessor &


16

Assembly Language
Binary to Decimal

Decimal Octal

Hexadeci
Binary
mal

17

CNET 315 Microprocessor & Assembly Language


Example
Bit “0”

1010112 => 1 x 20 = 1
1 x 21 = 2

CNET 315 Microprocessor &


Assembly Language
0 x 22 = 0
1 x 23 = 8
0 x 24 = 0
1 x 25 = 32
4310

18
Hexadecimal to Decimal

Decimal Octal

CNET 315 Microprocessor &


Assembly Language
Hexadeci
Binary
mal

19
Example

ABC16 => C x 16 0 = 12 x 1 = 12

CNET 315 Microprocessor &


Assembly Language
B x 16 1 = 11 x 16 = 176
A x 16 2 = 10 x 256 = 2560
2748 10

20
Decimal to Binary

Decimal Octal

CNET 315 Microprocessor &


Assembly Language
Hexadeci
Binary
mal

21
Example
12510 = ?2 2 125
2 62 1
2 31 0
2 15 1
2 7 1

CNET 315 Microprocessor &


Assembly Language
2 3 1
2 1 1
0 1

12510 = 1111101 2
22
Hexadecimal to Binary

Decimal Octal

CNET 315 Microprocessor &


Assembly Language
Hexadeci
Binary
mal

23
Example
10AF16 = ?2

1 0 A F

CNET 315 Microprocessor &


Assembly Language
0001 0000 1010 1111

10AF16 = 00010000101011112
24
Decimal to Hexadecimal

Decimal Octal

CNET 315 Microprocessor &


Assembly Language
Hexadeci
Binary
mal

25
Example
123410 = ?16

16 1234
16 77 2

CNET 315 Microprocessor &


Assembly Language
16 4 13 = D
0 4

123410 = 4D2 16
26
Binary to Hexadecimal

Decimal Octal

CNET 315 Microprocessor &


Assembly Language
Hexadeci
Binary
mal

27
Example
1010111011 2 = ?16

10 1011 1011

CNET 315 Microprocessor &


Assembly Language
2 B B

1010111011 2 = 2BB 16 28
Exercise – Convert ...
Hexa-
Decimal Binary decimal

33

CNET 315 Microprocessor &


Assembly Language
1110101
2BD

Don’t use a
calculator!
29
Basic Digital Devices
• Latch
• Flip Flop
• Register
• RAM

CNET 315 Microprocessor &


Assembly Language
• SRAM & DRAM
• ROM
• ALU

30
Latch
• What is a Latch?
A latch is a circuit that has two stable states and can

CNET 315 Microprocessor &


Assembly Language
be used to store state information.
• Example : RS-Latch

31
Latch

CNET 315 Microprocessor &


32

Assembly Language
Flip Flop
• What is a Flip Flop?
• flip-flop is a bistable multivibrator. The circuit
can be made to change state by signals applied
to one or more control inputs and will have one

CNET 315 Microprocessor &


Assembly Language
or two outputs
• Example: D-Flip Flop

33
Register
• What is a Register?

• A register (CPU register) is one of a small set of


data holding places that are part of the

CNET 315 Microprocessor &


Assembly Language
computer processor.
• A register may hold an instruction, a storage
address, or any kind of data (such as a bit
sequence or individual characters).

34
RAM
• Random Access Memory (RAM)
• SRAM
• Static RAM
• DRAM

CNET 315 Microprocessor &


Assembly Language
• Dynamic RAM
• SDRAM
• DDRAM

35
Static & Dynamic RAM
● Static RAM (SRAM) and Dynamic RAM (DRAM) are two
types of RAM.
● They both are different in many contexts like speed,
capacity.
● DRAM makes use of single transistor and capacitor for

CNET 315 Microprocessor &


Assembly Language
each memory cell.
● Memory cell of SRAM makes use of an array of 6
transistors.
● DRAM needs refreshing, whereas SRAM does not require
refreshing of the memory cell.
● Both retain data till the time they are supplied with power.
36
ROM – Read Only Memory
Different types of ROMs
• ROM : Read Only Memory
• PROM : Programmable Read Only Memory
• EPROM : Erasable Programmable Read

CNET 315 Microprocessor &


Assembly Language
Only Memory
• EEPROM : Electrically Erasable
Programmable Read Only Memory

37
ALU
Arithmetic and Logic Unit
➢ ALU is the part of a computer processor (CPU)
that carries out arithmetic and logic operations

CNET 315 Microprocessor &


Assembly Language
on the operands in computer instruction words.

➢ ALU is divided into two units, an arithmetic unit


(AU) and a logic unit (LU).

➢ Some processors contain more than one AU

38
Reference Book
- Douglas V. Hall, “Microprocessors and

CNET 315 Microprocessor &


Assembly Language
Interfacing ”

You might also like