Lecture 6 Back to binary Review Decoders 7 segment display Complexity of wiring Questions Outline Homework Binary May be short depending on what you remember from Discrete Math Questions ID: 352472
Download Presentation The PPT/PDF document "ITEC 352" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
Slide1
ITEC 352
Lecture 6
Back to binarySlide2
Review
Decoders
7 segment display
Complexity of wiring
Questions?Slide3
Outline
Homework
Binary
May be short depending on what you remember from Discrete MathSlide4
Questions
How can you tell if a number is negative in binary?
How can you tell if a number is 3.5743 in binary?
How can you tell if a set of binary digits is a String?
What do these questions lead you to believe about binary numbers?Slide5
Numeral systems
Numeral Vs. Number
same as difference between a word vs. the things it refers to.
numeral is a group of symbols that represents a number.
E.g., 15 can be represented as:
15, Fifteen, XV (roman)
What numeral system do we use everyday ? Slide6
Numeral
system (2)
Any numeral system is characterized by the number of digits used to represent numbers.
E.g.,
Unary system: ?
Binary system: ?
Octal: ?
Decimal: ?
The numeral system is called the
base.Slide7
Numeral system (3)
If we had lots of numeral systems in use, things will get confusing:
E.g., What is: 20 + 10 = ?
Is it:
30 ?
24?
12? Slide8
Number Systems
To make things easier for us: we use decimal number system as our base.
Every number in any other base is converted to decimal for us to be able to understand.
How do we do this conversion? Slide9
Radix
Determines the value of a number, by assigning a weight to the position of each digit.
E.g., Number 481
start all positions from 0.
Position of
“
1
”
: 0; weight of position: 1
Position of
“
8
”
: 1; weight of position: 10
Position of
“
4
”
: 2; weight of position: 100
Hence number: 4*100 + 8 * 10 + 1 * 1
Weight is calculated as 10^position
Any decimal number can be represented this way.
10 is called the
base or radix
of the number system.
We use notation ()
r
to represent the radix.
E.g., the decimal number 481 can also be written as: (481)
10Slide10
Other bases
Octal
Hexadecimal
Does it matter that you can convert between them?Slide11
Conversion
ChartSlide12
Basics
Conversion
How do you do it?
What is 10 in binary?
What is 100 in binary?Slide13
Adding
Subtracting
What is binary 1 + binary 0 = ?
What about binary 1 + binary 1 = ?
Addition is similar to decimal addition.
remember though that the answer will only use one of two digits: 0 or 1.
How about subtraction? Slide14
Subtraction
101 – 011 = Slide15
Subtraction
Subtraction introduces some challenges:
Answer maybe negative. How to represent negative binary numbers?
Subtraction isn’t easy: requires carry-ins…
Can we make it easier? What type of subtractions are easy to implement?
Can we use the same circuit for addition and subtraction. ?Slide16
Limitations
TWO key limitations:
It only represents positive numbers.
How do we accommodate negative numbers?
What about numbers that have too many digits?
A computer is bound by its data bus in the number of digits it can handle.
E.g., a 32 bit data bus, implies, the computer can store
upto
32 bits for a basic data such as a byte.
Ofcourse
, integers can be represented as multiple bytes, but this decreases the speed of
compuration
.
Solution: Floating Point Representation.
Next: Representing negative numbers.
Slide17
N
egative numbers
Our goal:
We want a representation of negative numbers such that:
Subtractions are as easy as additions:
Instead of subtraction we should be able to simply add.
Or
If it is a subtraction, there should be no carry.
We have some facts at our disposal. The number of bits you can use to represent any number in a computer is limited.Slide18
Complement notation.
The invention of complements.
Assume our computer is limited to two digits.
Find x in the following equation (restricting answer to two digits):
54
–
45 = 54 + x
Introducing 10
’
s complement
10
’
s complement of 45 = 55
10
’
s complement of 99 = 1
What is 54 + (10
’
s complement of 45) restricted to two digits ?
The 9
’
s complement for decimal digits:
9
’
s complement for 45 = 99
–
45 = 54
54 + 54 = 108
1 + 08 = 9 = 54 - 45Slide19
One’s complement
Invert all positions in the number
To subtract, add the numbers
If there is a carry out, add it to the first number in the result
DoneSlide20
Question
In one’s complement what are the following numbers?
000
111Slide21
Questions
On 3-bit architecture, what are all the positive and negative numbers that can be represented if numbers are represented in one’s complement notation?
Write down the binary representations of all the numbers. Slide22
Review
Binary
Numbering systems
Addition / Subtraction
One different way to represent them