itec 352 lecture 6 back to binary. binary review decoders 7 segment display complexity of wiring...
TRANSCRIPT
![Page 1: ITEC 352 Lecture 6 Back to binary. Binary Review Decoders 7 segment display Complexity of wiring Questions?](https://reader036.vdocuments.net/reader036/viewer/2022062421/56649dac5503460f94a9c285/html5/thumbnails/1.jpg)
ITEC 352
Lecture 6Back to binary
![Page 2: ITEC 352 Lecture 6 Back to binary. Binary Review Decoders 7 segment display Complexity of wiring Questions?](https://reader036.vdocuments.net/reader036/viewer/2022062421/56649dac5503460f94a9c285/html5/thumbnails/2.jpg)
Binary
Review
• Decoders• 7 segment display• Complexity of wiring• Questions?
![Page 3: ITEC 352 Lecture 6 Back to binary. Binary Review Decoders 7 segment display Complexity of wiring Questions?](https://reader036.vdocuments.net/reader036/viewer/2022062421/56649dac5503460f94a9c285/html5/thumbnails/3.jpg)
Binary
Outline
• Homework• Binary–May be short depending on what you
remember from Discrete Math
![Page 4: ITEC 352 Lecture 6 Back to binary. Binary Review Decoders 7 segment display Complexity of wiring Questions?](https://reader036.vdocuments.net/reader036/viewer/2022062421/56649dac5503460f94a9c285/html5/thumbnails/4.jpg)
Binary
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?
![Page 5: ITEC 352 Lecture 6 Back to binary. Binary Review Decoders 7 segment display Complexity of wiring Questions?](https://reader036.vdocuments.net/reader036/viewer/2022062421/56649dac5503460f94a9c285/html5/thumbnails/5.jpg)
Binary
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 ?
![Page 6: ITEC 352 Lecture 6 Back to binary. Binary Review Decoders 7 segment display Complexity of wiring Questions?](https://reader036.vdocuments.net/reader036/viewer/2022062421/56649dac5503460f94a9c285/html5/thumbnails/6.jpg)
Binary
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.
![Page 7: ITEC 352 Lecture 6 Back to binary. Binary Review Decoders 7 segment display Complexity of wiring Questions?](https://reader036.vdocuments.net/reader036/viewer/2022062421/56649dac5503460f94a9c285/html5/thumbnails/7.jpg)
Binary
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?
![Page 8: ITEC 352 Lecture 6 Back to binary. Binary Review Decoders 7 segment display Complexity of wiring Questions?](https://reader036.vdocuments.net/reader036/viewer/2022062421/56649dac5503460f94a9c285/html5/thumbnails/8.jpg)
Binary
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?
![Page 9: ITEC 352 Lecture 6 Back to binary. Binary Review Decoders 7 segment display Complexity of wiring Questions?](https://reader036.vdocuments.net/reader036/viewer/2022062421/56649dac5503460f94a9c285/html5/thumbnails/9.jpg)
Binary
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)10
![Page 10: ITEC 352 Lecture 6 Back to binary. Binary Review Decoders 7 segment display Complexity of wiring Questions?](https://reader036.vdocuments.net/reader036/viewer/2022062421/56649dac5503460f94a9c285/html5/thumbnails/10.jpg)
Binary
Other bases
• Octal• Hexadecimal• Does it matter that you can convert
between them?
![Page 11: ITEC 352 Lecture 6 Back to binary. Binary Review Decoders 7 segment display Complexity of wiring Questions?](https://reader036.vdocuments.net/reader036/viewer/2022062421/56649dac5503460f94a9c285/html5/thumbnails/11.jpg)
Binary
ConversionChart
![Page 12: ITEC 352 Lecture 6 Back to binary. Binary Review Decoders 7 segment display Complexity of wiring Questions?](https://reader036.vdocuments.net/reader036/viewer/2022062421/56649dac5503460f94a9c285/html5/thumbnails/12.jpg)
Binary
Basics
• Conversion– How do you do it?
• What is 10 in binary?• What is 100 in binary?
![Page 13: ITEC 352 Lecture 6 Back to binary. Binary Review Decoders 7 segment display Complexity of wiring Questions?](https://reader036.vdocuments.net/reader036/viewer/2022062421/56649dac5503460f94a9c285/html5/thumbnails/13.jpg)
Binary
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?
![Page 14: ITEC 352 Lecture 6 Back to binary. Binary Review Decoders 7 segment display Complexity of wiring Questions?](https://reader036.vdocuments.net/reader036/viewer/2022062421/56649dac5503460f94a9c285/html5/thumbnails/14.jpg)
Binary
Subtraction
• 101 – 011 =
![Page 15: ITEC 352 Lecture 6 Back to binary. Binary Review Decoders 7 segment display Complexity of wiring Questions?](https://reader036.vdocuments.net/reader036/viewer/2022062421/56649dac5503460f94a9c285/html5/thumbnails/15.jpg)
Binary
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. ?
![Page 16: ITEC 352 Lecture 6 Back to binary. Binary Review Decoders 7 segment display Complexity of wiring Questions?](https://reader036.vdocuments.net/reader036/viewer/2022062421/56649dac5503460f94a9c285/html5/thumbnails/16.jpg)
Binary
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.
![Page 17: ITEC 352 Lecture 6 Back to binary. Binary Review Decoders 7 segment display Complexity of wiring Questions?](https://reader036.vdocuments.net/reader036/viewer/2022062421/56649dac5503460f94a9c285/html5/thumbnails/17.jpg)
Binary
Negative 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.
![Page 18: ITEC 352 Lecture 6 Back to binary. Binary Review Decoders 7 segment display Complexity of wiring Questions?](https://reader036.vdocuments.net/reader036/viewer/2022062421/56649dac5503460f94a9c285/html5/thumbnails/18.jpg)
Binary
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 - 45
![Page 19: ITEC 352 Lecture 6 Back to binary. Binary Review Decoders 7 segment display Complexity of wiring Questions?](https://reader036.vdocuments.net/reader036/viewer/2022062421/56649dac5503460f94a9c285/html5/thumbnails/19.jpg)
Binary
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• Done
![Page 20: ITEC 352 Lecture 6 Back to binary. Binary Review Decoders 7 segment display Complexity of wiring Questions?](https://reader036.vdocuments.net/reader036/viewer/2022062421/56649dac5503460f94a9c285/html5/thumbnails/20.jpg)
Binary
Question
• In one’s complement what are the following numbers?
• 000• 111
![Page 21: ITEC 352 Lecture 6 Back to binary. Binary Review Decoders 7 segment display Complexity of wiring Questions?](https://reader036.vdocuments.net/reader036/viewer/2022062421/56649dac5503460f94a9c285/html5/thumbnails/21.jpg)
Binary
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.
![Page 22: ITEC 352 Lecture 6 Back to binary. Binary Review Decoders 7 segment display Complexity of wiring Questions?](https://reader036.vdocuments.net/reader036/viewer/2022062421/56649dac5503460f94a9c285/html5/thumbnails/22.jpg)
Binary
Review
• Binary• Numbering systems• Addition / Subtraction• One different way to represent them