1 of 63

Ali Adib Arnab�Senior Lecturer and Chairman, Department of Electrical and Electronic Engineering�University of Global Village�MSc in Telecommunication and Wireless Systems and Management, Queen Mary University of London

My Google Site Link: https://sites.google.com/view/ali-adib-arnab/home

2 of 63

Digital Electronics (EEE 207)

  • Marks Distribution:

​

  • Attendance:15 Marks
  • Quiz/Assignment/Presentation: 30 Marks
  • Midterm: 45 Marks
  • Final: 60 Marks

​

​

​

3 of 63

Topic 1

Digital System and Binary Numbers

4 of 63

Digital Computer and Digital System

  • Many scientific, industrial and commercial advances have been occurred through Digital Computer.
  • Examples:
    • Scientific Calculation
    • Commercial and business data processing
    • Air traffic control
    • Space guidance
    • Educational field
    • And many more…
  • Generality of digital computer - involves it everywhere.

5 of 63

Digital Systems and Binary Numbers

Digital age and information age

    • General purposes
    • Many scientific, industrial and commercial applications

Digital computers

    • Telephone switching exchanges
    • Digital camera
    • Electronic calculators, PDA's
    • Digital TV

Digital systems

    • Manipulate discrete elements of information
    • For example, {1, 2, 3, …} and {A, B, C, …}…

Discrete information-processing systems

6 of 63

Analog and Digital Signal

Analog system

The physical quantities or signals may vary continuously over a specified range.

Digital system

The physical quantities or signals can assume only discrete values.

Greater accuracy

t

X(t)

t

X(t)

Analog signal

Digital signal

7 of 63

  • Analog to digital data conversion:

8 of 63

Block diagram of

a digital computer:

9 of 63

Decimal Number System

  • Base (also called radix) = 10
    • 10 digits { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }
  • Digit Position
    • Integer & fraction
  • Digit Weight
    • Weight = (Base) Position
  • Magnitude
    • Sum of “Digit x Weight”
  • Formal Notation

1

0

-1

2

-2

5

1

2

7

4

10

1

0.1

100

0.01

500

10

2

0.7

0.04

d2*B2+d1*B1+d0*B0+d-1*B-1+d-2*B-2

(512.74)10

10 of 63

Octal Number System

  • Base = 8
    • 8 digits { 0, 1, 2, 3, 4, 5, 6, 7 }
  • Weights
    • Weight = (Base) Position
  • Magnitude
    • Sum of “Digit x Weight”
  • Formal Notation

1

0

-1

2

-2

8

1

1/8

64

1/64

5

1

2

7

4

5 *82+1 *81+2 *80+7 *8-1+4 *8-2

=(330.9375)10

(512.74)8

11 of 63

Binary Number System

  • Base = 2
    • 2 digits { 0, 1 }, called binary digits or “bits”
  • Weights
    • Weight = (Base) Position
  • Magnitude
    • Sum of “Bit x Weight”
  • Formal Notation
  • Groups of bits

8 bits = Byte

1

0

-1

2

-2

2

1

1/2

4

1/4

1

0

1

0

1

1 *22+0 *21+1 *20+0 *2-1+1 *2-2

=(5.25)10

(101.01)2

1 0 1 1

1 1 0 0 0 1 0 1

12 of 63

Hexadecimal Number System

  • Base = 16
    • 16 digits { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F }
  • Weights
    • Weight = (Base) Position
  • Magnitude
    • Sum of “Digit x Weight”
  • Formal Notation

1

0

-1

2

-2

16

1

1/16

256

1/256

1

E

5

7

A

1 *162+14 *161+5 *160+7 *16-1+10 *16-2

=(485.4765625)10

(1E5.7A)16

13 of 63

The Power of 2

n

2n

0

20=1

1

21=2

2

22=4

3

23=8

4

24=16

5

25=32

6

26=64

7

27=128

n

2n

8

28=256

9

29=512

10

210=1024

11

211=2048

12

212=4096

20

220=1M

30

230=1G

40

240=1T

Mega

Giga

Tera

Kilo

14 of 63

Number System

  • Number with different bases:

15 of 63

Number conversions for r=2

Decimal to Binary

Binary to Decimal

16 of 63

Decimal to Binary Binary to Decimal

Number conversions for r=2 with fractions

17 of 63

Decimal (Integer) to Binary Conversion

  • Divide the number by the ‘Base’ (=2)
  • Take the remainder (either 0 or 1) as a coefficient
  • Take the quotient and repeat the division

Example: (13)10

Quotient

Remainder

Coefficient

Answer: (13)10 = (a3 a2 a1 a0)2 = (1101)2

MSB LSB

13

/ 2 = 6

1 a0 = 1

6

/ 2 = 3

0 a1 = 0

3

/ 2 = 1

1 a2 = 1

1

/ 2 = 0

1 a3 = 1

18 of 63

Decimal (Fraction) to Binary Conversion

  • Multiply the number by the ‘Base’ (=2)
  • Take the integer (either 0 or 1) as a coefficient
  • Take the resultant fraction and repeat the division

Example: (0.625)10

Integer

Fraction

Coefficient

Answer: (0.625)10 = (0.a-1 a-2 a-3)2 = (0.101)2

MSB LSB

0.625

* 2 = 1 . 25

0.25

* 2 = 0 . 5 a-2 = 0

0.5

* 2 = 1 . 0 a-3 = 1

a-1 = 1

19 of 63

Decimal to Octal Conversion

Example: (175)10

Quotient

Remainder

Coefficient

Answer: (175)10 = (a2 a1 a0)8 = (257)8

175

/ 8 = 21

7 a0 = 7

21

/ 8 = 2

5 a1 = 5

2

/ 8 = 0

2 a2 = 2

Example: (0.3125)10

Integer

Fraction

Coefficient

Answer: (0.3125)10 = (0.a-1 a-2 a-3)8 = (0.24)8

0.3125

* 8 = 2 . 5

0.5

* 8 = 4 . 0 a-2 = 4

a-1 = 2

20 of 63

Binary − Octal Conversion

  • 8 = 23
  • Each group of 3 bits represents an octal digit

Octal

Binary

0

0 0 0

1

0 0 1

2

0 1 0

3

0 1 1

4

1 0 0

5

1 0 1

6

1 1 0

7

1 1 1

Example:

( 1 0 1 1 0 . 0 1 )2

( 2 6 . 2 )8

Assume Zeros

Works both ways (Binary to Octal & Octal to Binary)

21 of 63

Binary − Hexadecimal Conversion

  • 16 = 24
  • Each group of 4 bits represents a hexadecimal digit

Hex

Binary

0

0 0 0 0

1

0 0 0 1

2

0 0 1 0

3

0 0 1 1

4

0 1 0 0

5

0 1 0 1

6

0 1 1 0

7

0 1 1 1

8

1 0 0 0

9

1 0 0 1

A

1 0 1 0

B

1 0 1 1

C

1 1 0 0

D

1 1 0 1

E

1 1 1 0

F

1 1 1 1

Example:

( 1 0 1 1 0 . 0 1 )2

( 1 6 . 4 )16

Assume Zeros

Works both ways (Binary to Hex & Hex to Binary)

22 of 63

Octal − Hexadecimal Conversion

  • Convert to Binary as an intermediate step

Example:

( 0 1 0 1 1 0 . 0 1 0 )2

( 1 6 . 4 )16

Assume Zeros

Works both ways (Octal to Hex & Hex to Octal)

( 2 6 . 2 )8

Assume Zeros

23 of 63

Addition

  • Decimal Addition

5

5

5

5

+

0

1

1

= Ten ≥ Base

🡺 Subtract a Base

1

1

Carry

24 of 63

Binary Addition

  • Column Addition

1

0

1

1

1

1

1

1

1

1

0

+

0

0

0

0

1

1

1

≥ (2)10

1

1

1

1

1

1

= 61

​

= 23

= 84

25 of 63

Binary Subtraction

  • Borrow a “Base” when needed

0

0

1

1

1

0

1

1

1

1

0

−

0

1

0

1

1

1

0

= (10)2

2

2

2

2

1

0

0

0

1

= 77

​

= 23

= 54

26 of 63

Binary Multiplication

  • Bit by bit

0

1

1

1

1

0

1

1

0

0

0

0

0

0

0

1

1

1

1

0

1

1

1

1

0

0

0

0

0

0

1

1

0

1

1

1

0

x

27 of 63

1.5 Complements

  • There are two types of complements for each base-r system: the radix complement and diminished radix complement.
  • Diminished Radix Complement - (r-1)’s Complement
    • Given a number N in base r having n digits, the (r–1)’s complement of N is defined as:

(rn –1) – N

  • Example for 6-digit decimal numbers:
    • 9’s complement is (rn – 1)–N = (106–1)–N = 999999–N
    • 9’s complement of 546700 is 999999–546700 = 453299
  • Example for 7-digit binary numbers:
    • 1’s complement is (rn – 1) – N = (27–1)–N = 1111111–N
    • 1’s complement of 1011000 is 1111111–1011000 = 0100111
  • Observation:
    • Subtraction from (rn – 1) will never require a borrow
    • Diminished radix complement can be computed digit-by-digit
    • For binary: 1 – 0 = 1 and 1 – 1 = 0

​

​

​

​

28 of 63

Complements

  • 1’s Complement (Diminished Radix Complement)
    • All ‘0’s become ‘1’s
    • All ‘1’s become ‘0’s

Example (10110000)2

⇨ (01001111)2

If you add a number and its 1’s complement …

1 0 1 1 0 0 0 0

+ 0 1 0 0 1 1 1 1

1 1 1 1 1 1 1 1

29 of 63

Complements

  • Radix Complement

​

​

​

​

  • Example: Base-10

​

​

​

  • Example: Base-2

The r's complement of an n-digit number N in base r is defined as

rn – N for N ≠ 0 and as 0 for N = 0. Comparing with the (r − 1) 's complement, we note that the r's complement is obtained by adding 1 to the (r − 1) 's complement, since rn – N = [(rn − 1) – N] + 1.

The 10's complement of 012398 is 987602

The 10's complement of 246700 is 753300

The 2's complement of 1101100 is 0010100

The 2's complement of 0110111 is 1001001

30 of 63

Complements

  • 2’s Complement (Radix Complement)
    • Take 1’s complement then add 1
    • Toggle all bits to the left of the first ‘1’ from the right

Example:

Number:

1’s Comp.:

0 1 0 1 0 0 0 0

1 0 1 1 0 0 0 0

0 1 0 0 1 1 1 1

+ 1

OR

1 0 1 1 0 0 0 0

0

0

0

0

1

0

1

0

31 of 63

Complements

  • Example 1
    • Given the two binary numbers X = 1010100 and Y = 1000011, perform the subtraction (a) X – Y ; and (b) Y − X, by using 2's complement.

​

There is no end carry. Therefore, the answer is Y – X = − (2's complement of 1101111) = − 0010001.

32 of 63

Complements

  • Subtraction of unsigned numbers can also be done by means of the (r − 1)'s complement. Remember that the (r − 1) 's complement is one less then the r's complement.
  • Example 2
    • Repeat Example 1, but this time using 1's complement.

​

​

​

There is no end carry, Therefore, the answer is Y – X = − (1's complement of 1101110) = − 0010001.

33 of 63

Comparison between 1’s and 2’s Complements

  • Both of them have the advantages and disadvantages
  • Implementation:
    • 1’s complement:
      • Easier to implement (changing of 0s and 1s)

​

    • 2’s complement:
      • Implemented in two ways:
      • Adding 1 at the least significant digit of the 1’s complement
      • Leaving all ending 0s in the least significant positions and the first 1. Then changing all the 0s and 1s

34 of 63

Comparison between 1’s and 2’s Complements

  • Subtraction:
    • 1’s complement:
      • Requires two arithmetic addition operations when an end around carry occurs

​

    • 2’s complement:
      • Only one arithmetic addition operation is required
  • Another disadvantage of 1’s complement:
    • Two arithmetic zero: one with all 0s (positive) and another with all ones
  • (negative)
    • Example: 1100-1100=0 (using 1’s and 2’s complement)

35 of 63

Signed Binary Numbers

  • To represent negative integers, we need a notation for negative values.
  • It is customary to represent the sign with a bit placed in the leftmost position of the number since binary digits.
  • The convention is to make the sign bit 0 for positive and 1 for negative.
  • Example:

​

​

​

​

​

  • Table 1.3 lists all possible four-bit signed binary numbers in the three representations.

36 of 63

Signed Binary Numbers

37 of 63

Signed Binary Numbers

  • Arithmetic addition
    • The addition of two numbers in the signed-magnitude system follows the rules of ordinary arithmetic. If the signs are the same, we add the two magnitudes and give the sum the common sign. If the signs are different, we subtract the smaller magnitude from the larger and give the difference the sign if the larger magnitude.
    • The addition of two signed binary numbers with negative numbers represented in signed-2's-complement form is obtained from the addition of the two numbers, including their sign bits.
    • A carry out of the sign-bit position is discarded.
  • Example 3:

​

​

​

38 of 63

Binary Codes

  • BCD Code
    •  In this code each decimal digit is represented by a 4-bit binary number.BCD is a way to express each of the decimal digits with a binary code
    • A number with k decimal digits will require 4k bits in BCD.
    • Decimal 396 is represented in BCD with 12bits as 0011 1001 0110, with each group of 4 bits representing one decimal digit.
    • The binary combinations 1010 through 1111 are not used and have no meaning in BCD.

​

39 of 63

Binary Codes

  • Other Decimal Codes – weighted representation of decimal numbers in binary.

​

40 of 63

Binary Code

  • Example 4:
    • Consider decimal 185 and its corresponding value in BCD and binary:

​

​

​

  • BCD addition

​

​

​

41 of 63

Binary Code

  • Example 5:
    • Consider the addition of 184 + 576 = 760 in BCD:

​

​

​

​

​

​

​

42 of 63

Error Detection Code

  • Binary information – transmitted through communication medium such as wires or radio waves
  • External Noise – in physical communication medium changes bit values from 0 to 1 or vice versa
  • Error detection code – to detect error during transmission
    • Detected error can’t be corrected but indicated
  • Usual procedure is to observe the frequency of errors
    • Error –randomly occurred – nothing done/ retransmission of that message
      • Not that much effective error
    • Error – often occurred - system is checked for malfunction
      • Distort meaning of the received message

43 of 63

Error Detection Code…

  • Parity bit – an extra bit included with the message to make the total number of 1s either odd or even
  • Handle of parity bit during information transfer –
    • Sending end –
      • Parity Generation – from the message, generate the parity bit, P
      • The message including its parity bit, P sent to the destination
    • Receiving End
      • Parity Check – all incoming bits are checked whether proper parity is adopted or not. If
  • the checked parity does not correspond to the adopted one, error detected.
      • If matched with adopted parity, discard the parity bit, P and sent to the original service
  • The parity method detects the presence of odd number of errors. Even number of errors are undetectable. (?)

44 of 63

Error Detection Code…

45 of 63

The Reflected Code

  • The benefit of the reflected code over binary numbers is that a number in the reflected code changes by only one bit as it proceeds from one number to the next.
  • Motivation: To indicate position/state , closing or opening switches are in several devices.
  • If they use natural binary number, state 3 (011) and 4 (100) are next to each other but all three bits are different.
  • Physical switches are not ideal, unlikely to change states exactly in synchrony

46 of 63

The Reflected Code…

In the brief period of changing, the switches will read some spurious position.

Transition might look like 011-001-101-100

The observer can not tell if that is reading a real position or a transitional state between two states.

The reflected binary code solves this problem- changing only one switch at a time – cyclic property.

Also known as Gray code, Single distance code (Hamming distance=1)

47 of 63

The Reflected Code…

48 of 63

Alphanumeric Code

  • A binary code of a group of elements consisting of ten decimal digits, 26 letters of the alphabet, and certain number of special symbols like
  • {$,#,.,/…}
  • Also known as alphameric
  • More than 36 characters.
  • At least required: log2 (36) = 5.1699 ≈ 6 bits
  • Upper and lower case letters and other characters increase the number of bits
  • Internal code (6 bits), ASCII code (7 bits), EBCDIC code (8 bits)

49 of 63

Alphanumeric Code…

50 of 63

ASCII Character Codes

American Standard Code for Information Interchange (Refer to Table 1.7)

A popular code used to represent information sent as character-based data.

It uses 7-bits to represent:

    • 94 Graphic printing characters.
    • 34 Non-printing characters.

Some non-printing characters are used for text format (e.g. BS = Backspace, CR = carriage return).

Other non-printing characters are used for record marking and flow control (e.g. STX and ETX start and end text areas).

51 of 63

Binary Codes

  • Gray Code
    • The advantage is that only bit in the code group changes in going from one number to the next.
      • Error detection.
      • Representation of analog data.
      • Low power design.

​

52 of 63

Binary Storage and Registers

  • Information in binary form – stored in binary storage elements for individual bits
  • Binary Cell – having two stable states – store one bit of information
  • Examples: Binary cells as flip-flop, ferrite cores, punch card with holes

​

​

1bit

Cell

Excitation signal to set a state

Physical quantity that differs

between two states

53 of 63

Registers

  • Register – a group of binary cell
  • N-cell register – store n bit discrete information
  • State of register – n-tuple number of 1s and 0s
    • Each bit designating the state of one cell in the register
  • Content of a register – a function of the interpretation of stored information in it.
  • Example of 16 bits register:

​

​

  • Same bit configuration may be interpreted differently for different types of elements of information (types should be synched with the computer)

54 of 63

Register Transfer

  • Registers in different components:
    • Processor Unit: store operands upon which operations are performed
    • Control Unit: keep track of various computer sequences
    • I/O devices: store information transferred to or from the device
  • To process binary information, a computer must have:
    • Devices which hold the data to be processed (Register)
    • Circuit elements which manipulate data (Logic circuit)

55 of 63

Transfer of Information among Registers

56 of 63

Example of Binary Information Processing

57 of 63

Switching Circuits and Binary Signal

  • Application of Binary logic – simple switching circuits (made of switches)
  • Binary logic variable A can be represented as a switch A as following :

circuit.

  • Conduct current – switch on
  • Not conducting current – switch off

Logic 1 Logic 0

​

  • Electronic digital circuit uses transistor as switches – named as switching

58 of 63

Switching Circuits

L = A + B

L = A . B

L = A‘

bulb

Switch A

59 of 63

Switching Circuits

  • Switches – controlled electrical signal – current or voltage
  • Voltage operated circuit – two separate voltage level
  • Current operated circuit – (in transistors) cut off or saturation states

60 of 63

Logic Gate

  • Logic gate – establish logical manipulation path carrying one bit of information
  • Also named as digital circuit, logic circuit or switching circuit
  • Mathematical representation – Boolean algebra

61 of 63

Integrated Circuits

  • Digital circuit constructed with integrated circuit
  • IC – small semiconductor crystal named as chip
    • Components of Chip – transistors, diodes, resistors, capacitors and so on
    • These components are interconnected inside
    • This chip is mounted on a metal/plastic package and connections are made of external pin
    • Differ from other detachable electronic circuit
  • Two types of packages
    • Flat
    • Dual in Line

62 of 63

Integrated Circuits

  • Advantages:
    • Small in size
    • Cost effective
    • Reduced power consumption
    • High reliability against failure
  • Linear and Digital IC – continuous and discrete data
  • Based number of gates inside – SSI, MSI, LSI, VLSI IC

63 of 63

Published Papers��[1] Ali Adib Arnab, Sheikh Sadia Afrin, F.M. Fahad, Hasan U. Zaman, "A cost effective way to build a web controlled search and CO detector rover," DOI:10.1109/CCWC.2017.7868451 (Received the track Best Paper Award), Proceedings of the 7th IEEE Annual Computing and Communication Workshop and Conference (IEEE CCWC 2017), Las Vegas, USA, 9-11 January, 2017, Publisher: IEEE�[2] Ali Adib Arnab, Sheikh Md. Razibul Hasan Raj, John Schormans, Sultana Jahan Mukta, Nafi Ahmad "Analysis of the Cost of Varying Levels of User Perceived Quality for Internet Access," https://doi.org/10.1007/978-3-030-68154-8_36 , Proceedings of the 3rd International Conference on Intelligent Computing & Optimization – ICO 2020, Hua Hin, Thailand, 22-23 April, 2021, Publisher: Springer

  • Research and Teaching Interests: 
  • Wireless and Mobile Communication
  • Telecommunication Engineering
  • Communication Theory
  • Electronics
  • Internet of Things
  • Digital Electronics
  • Renewable Energy
  • VLSI

​