CNET 315 Microprocessors & Assembly Language Phiros Mansur Nalakath Course Coordinator Jazan University CNET 315 Microprocessor & Assembly Language
Chapter 1 COMPUTER NUMBER SYSTEMS & DIGITAL DEVICES CNET 315 Microprocessor & Assembly Language
Objectives of Chapter-1 To understand the basic number systems used in Computers. To Conversions between the major number systems To understand fundamentals of devices like Latches, Flip Flops, Registers, RAM, ROM and ALU etc. CNET 315 Microprocessor & Assembly Language
Number Systems Number System Base Symbols Used by humans? Used in computers? Decimal 10 0, 1, … 9 Yes No Binary 2 0, 1 Hexa- decimal 16 0, 1, … 9, A, B, … F CNET 315 Microprocessor & Assembly Language
Quick Example 2510 = 110012 = 1916 Base CNET 315 Microprocessor & Assembly Language
Weight 12510 => 5 x 100 = 5 2 x 101 = 20 1 x 102 = 100 125 Base CNET 315 Microprocessor & Assembly Language
Quantities/Counting (1 of 3) Decimal Binary Hexa- decimal 1 2 10 3 11 4 100 5 101 6 110 7 111 CNET 315 Microprocessor & Assembly Language
Quantities/Counting (2 of 3) Decimal Binary Hexa- decimal 8 1000 9 1001 10 1010 A 11 1011 B 12 1100 C 13 1101 D 14 1110 E 15 1111 F CNET 315 Microprocessor & Assembly Language
Quantities/Counting (3 of 3) Decimal Binary Hexa- decimal 16 10000 10 17 10001 11 18 10010 12 19 10011 13 20 10100 14 21 10101 15 22 10110 23 10111 CNET 315 Microprocessor & Assembly Language
Binary Number System Binary Number System has base 2. It uses the digits 0 and 1 only Example : 101011 CNET 315 Microprocessor & Assembly Language
Binary Addition
Addition - Example
Binary Subtraction Just like subtraction in any other base Minuend 10110 Subtrahend - 10010 Difference 00100 And when a borrow is needed. Note that the borrow gives us 2 in the current bit position. . 9/15/09 - L15 Decoders, Multiplexers Copyright 2009 - Joanne DeGroat, ECE, OSU
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 162 ) + (F x 161) + (4 x 160)
Hexadecimal (Hex) Extra Digits Decimal Value Hexadecimal Digit 10 A 11 B 12 C 13 D 14 E 15 F
Hexadecimal Addition CNET 315 Microprocessor & Assembly Language
Binary to Decimal Decimal Octal Binary Hexadecimal CNET 315 Microprocessor & Assembly Language
Example Bit “0” 1010112 => 1 x 20 = 1 1 x 21 = 2 0 x 22 = 0 1 x 23 = 8 0 x 24 = 0 1 x 25 = 32 4310 CNET 315 Microprocessor & Assembly Language
Hexadecimal to Decimal Octal Binary Hexadecimal CNET 315 Microprocessor & Assembly Language
Example ABC16 => C x 160 = 12 x 1 = 12 B x 161 = 11 x 16 = 176 A x 162 = 10 x 256 = 2560 274810 CNET 315 Microprocessor & Assembly Language
Decimal to Binary Decimal Octal Binary Hexadecimal CNET 315 Microprocessor & Assembly Language
Example 2 125 62 1 12510 = ?2 2 31 0 2 15 1 2 7 1 2 3 1 2 1 1 2 0 1 12510 = 11111012 CNET 315 Microprocessor & Assembly Language
Hexadecimal to Binary Decimal Octal Binary Hexadecimal CNET 315 Microprocessor & Assembly Language
Example 10AF16 = ?2 1 0 A F 0001 0000 1010 1111 10AF16 = 00010000101011112 CNET 315 Microprocessor & Assembly Language
Decimal to Hexadecimal Octal Binary Hexadecimal CNET 315 Microprocessor & Assembly Language
Example 123410 = ?16 16 1234 77 2 16 4 13 = D 0 4 123410 = 4D216 CNET 315 Microprocessor & Assembly Language
Binary to Hexadecimal Decimal Octal Binary Hexadecimal CNET 315 Microprocessor & Assembly Language
Example 10101110112 = ?16 10 1011 1011 B B 10101110112 = 2BB16 CNET 315 Microprocessor & Assembly Language
Exercise – Convert ... Decimal Binary Hexa- decimal 33 1110101 2BD Don’t use a calculator! CNET 315 Microprocessor & Assembly Language
Basic Digital Devices Latch Flip Flop Register RAM ROM ALU SRAM & DRAM CNET 315 Microprocessor & Assembly Language
Latch What is a Latch? A latch is a circuit that has two stable states and can be used to store state information. . Example : RS-Latch CNET 315 Microprocessor & Assembly Language
Latch CNET 315 Microprocessor & 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 or two outputs Example: D-Flip Flop CNET 315 Microprocessor & Assembly Language
Register What is a Register? A register may hold an instruction, a storage address, or any kind of data (such as a bit sequence or individual characters). A processor register (CPU register) is one of a small set of data holding places that are part of the computer processor. CNET 315 Microprocessor & Assembly Language
RAM Random Access Memory (RAM) SRAM DRAM Static RAM Dynamic RAM SDRAM DDRAM CNET 315 Microprocessor & Assembly Language
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 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. CNET 315 Microprocessor & Assembly Language
ROM – Read Only Memory Different types of ROMs ROM : Read Only Memory PROM : Programmable Read Only Memory EPROM : Erasable Programmable Read Only Memory EEPROM : Electrically Erasable Programmable Read Only Memory CNET 315 Microprocessor & Assembly Language
ALU Arithmetic and Logic Unit ALU is the part of a computer processor (CPU) that carries out arithmetic and logic operations 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 CNET 315 Microprocessor & Assembly Language
Reference Book 1. Douglas V. Hall, “Microprocessors and Interfacing ” CNET 315 Microprocessor & Assembly Language