Digital Computers and Information Chapter 1 Mano and Kime
Digital Computers and Information Digital Computers Number Systems Arithmetic Operations Decimal Codes Error Detection and Correction
Block Diagram of Computer
Memory ROMs and PROMs EPROMs, EEPROMs and Flash Memory Static RAMs and Dynamic RAMs
ROMs and PROMs ROM –Read-Only Memory PROM –Programmable Read-Only Memory
EPROMs, EEPROMs and Flash Memory EPROM –Erasable Programmable Read-Only Memory –Erase with ultraviolet light EEPROM –Electrically-Erasable Programmable Read-Only Memory Flash Memory –Electrically-Erasable in bulk
RAMs RAM –Random-Access Memory –Read-Write Memory Static RAM –Needs 4 transistors per bit to make a latch –Data lost when power is turned off Dynamic RAM –One transistor per bit –Data stored as charge on a capacitor –Data must be continually refreshed
W8X Microcontroller Control Unit Datapath
The W8Z Microprocessor
Digital Computer and Information Digital Computers Number Systems Arithmetic Operations Decimal Codes Error Detection and Correction
Powers of 2
Numbers with Different Bases
Number Systems N =...P 3 P 2 P 1 P 0. P -1 P -2 P =... + P 3 b 3 + P 2 b 2 + P 1 b 1 + P 0 b 0 + P -1 b -1 + P -2 b -2 + P -3 b = 3 x x x x x = =
Number Systems N =...P 3 P 2 P 1 P 0. P -1 P -2 P =... + P 3 b 3 + P 2 b 2 + P 1 b 1 + P 0 b 0 + P -1 b -1 + P -2 b -2 + P -3 b = 1 x x x x x x 2 -2 = /2 + 1/4 = Binary
Number Systems N =...P 3 P 2 P 1 P 0. P -1 P -2 P =... + P 3 b 3 + P 2 b 2 + P 1 b 1 + P 0 b 0 + P -1 b -1 + P -2 b -2 + P -3 b AB.6 16 = 1 x A x B x x = 1 x x x 1 + 6/16 = = Hex
Number Systems N =...P 3 P 2 P 1 P 0. P -1 P -2 P =... + P 3 b 3 + P 2 b 2 + P 1 b 1 + P 0 b 0 + P -1 b -1 + P -2 b -2 + P -3 b = 1 x x x x x 8 -2 = 1 x x x 1 + 2/8 + 5/64 = = Octal
Examples Convert the following binary numbers to decimal:
Digital Computer and Information Digital Computers Number Systems Arithmetic Operations Decimal Codes Error Detection and Correction
Recall Full Adder Truth Table C i A i B i S i C i A B C Final carry = 0
Binary Addition E Dec Hex Binary
Number System Conversions Hex, Binary, and Octal to Decimal Binary Hex Binary Octal Hex Octal Decimal to Hex, Octal, and Binary
Hex to Decimal 87C987C9 x x 16 2, ,172 x 16 34, ,761
Binary Hex A8. F 5 C
Binary Octal
Hex Octal Go through Binary A8. F 5 C
Convert Decimal to any Base Integer Part: Divide by the base, keep track of the remainder, and read up , ,172rem rem 12 = C 16 8 rem 7 0 rem 8 Read up 34, = 87C9 16
Convert Decimal to any Base Fractional Part: Multiply by the base, keep track of the integer part, and read down x 16 = 12.5 int = 12 = C 0.5 x 16 = 8.0 int = 8 Read down = 0.C8 16
Convert Decimal to any Base Fractional Part: Multiply by the base, keep track of the integer part, and read down. 0.1 x 2 = 0.2 int = x 2 = 0.4 int = x 2 = 0.8 int = x 2 = 1.6 int = x 2 = 1.2 int = x 2 = 0.4 int = x 2 = 0.8 int = 0 Read down =
Examples Convert the following numbers from the given base to the other three bases listed in the table: DecimalBinaryOctalHex ??? ? ?? ??326.5? ???F3C7.A
Binary Coded Decimal Code decimal numbers using the binary digits, That is, Can NOT use the hex digits A - F. For example, the DECIMAL number 3582 would be coded in BCD as While this looks like the HEX number 3582H in BCD we interpret it as the DECIMAL number 3582.
BCD Addition Binary 35H H CH Decimal (BCD) 35H H H B0 35 MOV AL,35H ;AL = 35H ADD AL,47H ;AL = AL+47H DAA ;Decimal adjust
Digital Computer and Information Digital Computers Number Systems Arithmetic Operations Decimal Codes Error Detection and Correction
Use of Parity Bit - Extra bit included to make the total number of 1’s either even or odd. Refer to page : 22 for an example. * If a parity error is detected at the receiving end, it can request for a retransmission.
More topics… Fixed and Floating point numbers – Refer to the ppt presentation on the course website.