Presentation is loading. Please wait.

Presentation is loading. Please wait.

Digital Electronics and Computer Interfacing Tim Mewes 3. Digital Electronics.

Similar presentations


Presentation on theme: "Digital Electronics and Computer Interfacing Tim Mewes 3. Digital Electronics."— Presentation transcript:

1 Digital Electronics and Computer Interfacing Tim Mewes 3. Digital Electronics

2 Digital Electronics and Computer Interfacing2 3.1 Digital Information Information is stored in two distinct physical states –Charge state of a capacitor (DRAM) –Magnetization direction (Hard disk, MRAM) –… The two states are referred to as –TRUE/FALSE (Boolean) –1/0 –On/Off –High/Low

3 Digital Electronics and Computer Interfacing3 3.1 Digital Information Information can be transmitted using: discrete Voltage levels –TTL: 1: 2.0 V or greater 0: 0.8 V or less –CMOS: 1: 3.7 V or greater 0: 1.3 V or less –… Light –typical wavelengths: 850, 1310, or 1550 nm Radio frequencies –Bluetooth 2.4GHz –…

4 Digital Electronics and Computer Interfacing4 3.2 Digital number representation 3.2.1 Unsigned integers use base 2 (binary) representation: 167 10 =1  2 7 +0  2 6+ 1  2 5 +0  2 4 +0  2 3 +1  2 2 +1  2 1 +1  2 0 =1010 0111 2 Each digit in the binary representation is called a bit Eight bits are called a byte The largest possible number that can be represented by n-bits is 2 n -1 (255 in case of a byte) The leftmost bit is also called most significant bit The rightmost bit is also called least significant bit

5 Digital Electronics and Computer Interfacing5 3.2.1 Unsigned integers How to convert from base 2 to base 10? Example: 11001001, n=8 bits Most significant bit 1  2 n-1 =1  2 7 =128  128 1  2 n-2 =1  2 6 =64  64 0  2 n-3 =0  2 5 =0  0 0  2 n-4 =0  2 4 =0  0 1  2 n-5 =1  2 3 =8  8 0  2 n-6 =0  2 2 =0  0 0  2 n-7 =0  2 1 =0  0 1  2 n-8 =1  2 0 =1  1 Sum: 201

6 Digital Electronics and Computer Interfacing6 3.2.1 Unsigned integers How to convert from base 10 to base 2? Example: 100 with n=8 bits Most significant bit 2 n-1 =2 7 =128 > 100  0 2 n-2 =2 6 =64 < 100  1 100-64 = 362 n-3 =2 5 =32 < 36  1 36-32 = 42 n-4 =2 4 =16 > 4  0 2 n-5 =2 3 =8 > 4  0 2 n-6 =2 2 =4 = 4  1 4-4 =02 n-7 =2 1 =2> 0  0 2 n-8 =2 0 =1> 0  0 100 10 =01100100 2

7 Digital Electronics and Computer Interfacing7 3.2.2 Signed integers Sign-and-magnitude Use the most significant bit to represent the sign 0 represents ‘+’, 1 represents ‘-’ For n-bits numbers from -2 n-1 +1 to 2 n-1 -1 can be represented Advantage: similar to the way we usually indicate the sign of a number Disadvantage: arithmetic calculations tricky Zero has two representations: -0 10 =1000 0000 2 +0 10 =0000 0000 2

8 Digital Electronics and Computer Interfacing8 3.2.2 Signed integers Ones’ complement Negative numbers are represented by complementing all the bits (1  0) of the binary representation of the magnitude of the number 42 10 = 0010 1010 2 -42 10 = 1101 0101 2 Zero still has two representations

9 Digital Electronics and Computer Interfacing9 3.2.2 Signed integers Two’s complement For negative numbers calculate the ones’ complement and add 1 to the result: 42 10 = 0010 1010 2 Ones’ complement: -42 10 = 1101 0101 2 Two’s complement: -42 10 = 1101 0110 2 Zero has only one representation Range for n bits: -2 n-1 to 2 n-1 -1 (-128 to +127 for a byte) Advantage: convenient for computer arithmetic

10 Digital Electronics and Computer Interfacing10 3.2.3 Comparison (4-Bit) Base 10Unsigned IntegerSign-and-magnitudeOnes’ complementTwo’s comlement +81000--- +70111 +60110 +50101 +40100 +30011 +20010 +10001 +00000 -0-10001111- -100111101111 -2-101011011110 -3-101111001101 -4-110010111100 -5-110110101011 -6-111010011010 -7-111110001001 -8---1000

11 Digital Electronics and Computer Interfacing11 3.3 Gates A logic gate is an arrangement of switches to calculate operations using Boolean logic in digital circuits The output of a gate only depends on its inputs and not its history

12 Digital Electronics and Computer Interfacing12 3.3 Gates A Q A B Q A B Q

13 Digital Electronics and Computer Interfacing13 3.3 Gates A B Q A B Q A B Q

14 Digital Electronics and Computer Interfacing14 3.4 Boolean algebra associativity: commutativity: absorption: complements: distributivity: De Morgan’s theorem:

15 Digital Electronics and Computer Interfacing15 3.4 Boolean algebra How many gates do we really need? Just one: either NAND or NOR (universal gates)! One can build all other gates using for example only NAND: AND: NOT: OR: XOR:


Download ppt "Digital Electronics and Computer Interfacing Tim Mewes 3. Digital Electronics."

Similar presentations


Ads by Google