Docsity

Digital notes from class, Lecture notes of Digital Systems Design

Partial preview of the text

Download Digital notes from class and more Lecture notes Digital Systems Design in PDF only on Docsity!

EEE 3342C: Digital Systems

Introduction: Number Systems and Conversion

Instructor: Dr. Suboh A. Suboh Department of Electrical Engineering and Computer Science

Numbers

What does this number represent?

10

Consider the “context” within which the number is used.

There are other number systems

  • When we write in base 10; we use numbers from 0 to 9
  • When we write in base 8, we use numbers 0 to 7
  • When we write in hexadecimal (base 16), we use 0 to 9 and A,

B, C, D, E, F (A=10, …, F=15)

  • When we write in base 2 (or binary), we use 0 and 1
  • Why are binary numbers interesting? Because we can put them

in computers?

  • An 8-bit binary number looks like 10010101
  • There are 8 wires, when there is an electric signal, it is 1, when

there is no electric signal, it is 0

Another example in base 10

Now with fractional parts

1

0

  • 1
  • 2

Numbers in Base 5

Then, 341.21 (base 5) is equal to 96.44 (base 10)

341.21 (base 5) Written as

5

5

A number in Hexadeximal (Base 16)

  • Digits used in hexadecimal numbers are: 0 1 2 3 4 5 6 7 8 9 A B C D E F

2A3 (base 16)

2

1

0

512 + 160 + 3 = 675 = 2A

16

Convert to binary

  • Convert 47 to binary

Remainders a 0 ① a 1 ① a 2 ① a 3 ① a 4 ⓪ a 5 ①

binary number: a 5 a 4 a 3 a 2 a 1 a 0

  • So the binary number is: 101111
    • Write in the opposite direction
  • 47 10

2

  • Let’s verify:

5

4

3

2

1

0

Convert to binary with fractions

  • Convert 0.375 to binary

0.375 * 2 = ⓪.75 Take only the decimal part

  • So the binary number is: 0.
    • Write in the same direction
    10

2

  • Let’s verify:

Base 10 to Base 4

  • 27 10

4

Remainders: 3 2 1

  • Write in the opposite direction
  • 27 10

4

  • Let’s verify: 116 + 24 + 3*1 = 27

There are two ways to find Hexadecimals

10

16

The regular way:

Remainders: 5 4 1

Then, 325

10

16

*The other way, find 325 in base 2, then group 4 bits together

starting from the right side*

325 /2 = 162 / 2 = 81 / 2 = 40 / 2 = 20 / 2 = 10 / 2 = 5 / 2 = 2 / 2 = 1 / 2 = 0 1 0 1 0 0 0 1 0 1 325 = 101000101 = 0001 0100 0101 1 4 5 = 145 16

Convert from base x to base y

  • 34 7

3

  • Convert 34 7

to base 10, then convert to base 3

  • 34 7

10

  • Now convert 25 10

to base 3

  • 25 / 3 = 8 / 3 = 2 / 3 = 0
  • Then: 34 7

3

Example: Convert 0. 10 to binary

  • Convert 0.7 to binary
    10

2

  • Similar to how 10/3 = 3.33333…

Try This

  • Open the calculator in Windows
    • Start  Accessories  Calculator
  • For Windows 7
    • Make sure it is in “Programmer” mode
    • View  Programmer
  • Now you can select
    • HEX: hexadecimal (base 16)
    • Dec: decimal (base 10)
    • Oct: octal (base 8)
    • Bin: binary (base 2)
  • It can do calculations in other bases or convert a number from a
base to another

Binary Arithmetic

  • Addition in binary is simple. It’s similar to addition of

decimal numbers. Go over the bits one by one.

0 + 0 = 0 0 + 1 = 1 1 + 0 = 1 1 + 1 = 0 and carry 1 to the next column Carry-in=1; 1+1 =1 and carry-out = 1 in next column 1 1 0 1 1 0 1 1 0 1 0 0 1 1 0 1 0 1 0 1 1

54 52 106