The digital logic level - intro to binary (week 3)

Numerical system

What is a numerical system?

This is a way of representing numbers i.e your fingers

What is a positional system?

This is when a numbers position defines its weight, for example in our number system moving to the left increase the weight by 10

What is the other way of saying positional system?

place-value notation

examples

What base is our decimal number system?

base 10

0 to 9

How much does a position effect a numbers weight?

What is the equation for a numbers value?

sum(weight(is it in the tens or hundreds) * digit(is its a 9 or 1))

What does the subscript represent?

The base value of a number

What base is binary?

base 2

0 to 1

What base is octal?

base 8

0 to 7

Binary

What does ve+ and ve- stand for?

A positive and Negative number respectively

How to convert decimal to binary DIVISION METHOD
How to convert decimal to binary SUBTRACTION METHOD
  1. Subtract the largest 2^n you can
  1. Add a one
  1. 2^(n-1) if cannot subtract then add a 0 else add a 1
  1. repeat until you reach 2^0
What is a bit?

1 or 0

What is a nibble?

4 bits

What is a byte?

8 bits or 2 nibbles

What is a word?

The amount of data the cpu can process in one go, i.e. 32bit or 64bit

Binary table
What is signed binary?

This is where the largest bit represents 1 = -ve and 0 = +ve

How to add signed binary?
  1. Add like normal, so if
    1. 1 + 1 = carry the one
    1. 0 + 1 = 1
    1. 0 + 0 = 0
  1. If you get a overflow carry it around to the start and add it

How to do ones compliment and convert a positive number to a negative one?
  1. Flip all bits
In ones compliment is 0 positive or negative?

It is both, thats why it is bad

What do you do with a overflow?

Carry it to the start and add it

How to convert a ones compliment to a digit?
  1. If the signed bit is negative (1), filp all bits
  1. Add the bits up

What is twos compliment?

This is where the most significant bit is negative

Why is twos compliment better than ones compliment?
  • It is slow
  • It is hard to implement into hardware
  • Doesn't have the -+0 problem
What do you do if there if a overflow bit in twos compliment?

Leave it, on the left


What is the most significant bits value in all the different methods 4bit?

SB +-

1s -7 (flip everything then read it)

2s -8

How do you convert a positive number negative or visa versa in twos compliment?

Flip all bits and then add one

How to multiply?
  1. Look at the bottom row, look at the first bit, multiply that by each bit above
  1. Once completed shift to the left, then repeat till no more bits
  1. Finally add them

0000 0101

0000 0011


0000 0101

0000 1010 +


0000 1111

What base is Hexadecimal?

base 16

Write out the conversion from decimal to hex
  1. 1
  1. 2
  1. 3
  1. 4
  1. 5
  1. 6
  1. 7
  1. 8
  1. 9
  1. A
  1. B
  1. C
  1. D
  1. E
  1. F
How to convert binary to Hex?

first split into groups of nibbles

0100 1101

then convert the nibbles into denery

4 D