We're in chapter 15. The subject is digital electronics.
Modern computers are composed mostly of digital circuits. It is critical to understand the building blocks of digital circuits that comprise computer and computer related equipment. I have another course I teach which introduces information technology fundamentals. One of the ways that you can view a computer is that of being a binary processing machine.
Digital circuits are composed of devices and circuits that are conventional in nature and repeat many of the structures we have looked at in this class, things like transistors, capacitors, resistors, inductors, all of these things are used as building blocks for digital circuits.
Digital Concepts and Terminology
There are fundamental concepts and terms related to digital technology that is essential to master in order to understand their operation. The binary numbering system forms the basis for all digital logic systems and is critical to the understanding of digital concepts.
Interpretation of Binary Numbers
We're going to get very familiar with binary numbering. Now understand the binary numbering system a comparison between binary and decimal is useful. Here we have a table of characteristics and we're going to be looking at the decimal system and then comparing it with the binary.
Indication of number system. Here we have the subscript 10, and we see this number 259 and the 10 right here. This is simply indicating that this is a base 10 numbering system. When we say base 10 what that means is that there are 10 digits. On this next column here it mentions zero, one, two, three, four, five, six, seven, eight, nine. Notice, there's no 10 here, but there is a zero. This represents 10 digits. The system that we're most familiar with is the decimal system and the reason we call it call decimal is because there are 10 digits.
Then, we have the binary system and the subscript two is used. Instead of two, three, four, so on, there are just two digits and the two digits are going to be zero and one, and the little two here tells me that this is a binary system. Say I had a number one, zero, one, ten, that would be representing the number 101; whereas, if I had one, zero, one, that would be a binary value.
The weights of the digits positions and we're going to go over this on the next screen here, but just briefly, you notice here that we have a base 10 systems and we raise them to the different powers and we get different values, and so ten to the zero. Something to remember is that any number raised to the zero power is going to be one, ten to the first power is 10, 10 squared is 100, 10 to the third is 1,000, and so on. With binary, it's a little bit different experience. We say two the zero power is going to be one like any number raised to the zero power is one; two the first power, two; two squared, four; etcetera. The determination of the value, to the determine the value you would multiply each digit by the value of the position weight. That would be same in both of these.
Weighted Values Decimal/Binary
Let's look at a number and see what we're talking about when we do this. Here we have two values and we want to determine what is the value of each of these numbers. Here we have 127 and the 10 here tells me this is the base 10 number, and so we know that that equals 127. How do we come up with that? We can view this, in fact, usually, the typical way you did this in grade school was this is the one's column, this was the tens column, and this was the 100s column. With base 10, let's look at it as powers of 10. This first digit would be the 10 to the zero column. This would be the 10 to the first power. This would be 10 squared, and if we went on it would be 10 to the third. We're not going to go there. The last item in that previous list had said multiply each digit by the value of the position and that's in order to determine the value. If we go to this value, for example, seven, our weighted value here is 10 to the zero which is one, so we could say seven times one and we'd say that equals seven. Then, the two here, two times 10 to the first power, which is 10, would be 20, and one times 10 to the second power would be 100. We have an evaluated the weight of each digit, and now if we add them up we say this is 127 and we come to that value. Students say I'm not in third grade of whatever [inaudible 0:05:51] do it anyway. This is how we would look at a decimal number.
With binary, It's not intuitive to do this. In this case, we're looking at powers of two. Here we would have two to the zero which is one; and two to the first power which is two; two the second which is four; two to the third which is eight; two to the fourth, 16; two the fifth, 32; two to the sixth, 64; and two to the seventh is 128. What you might notice here, here the values are going to double each time, one, two, four, eight, sixteen, 32, and so on and so forth. These are the values that are assigned to each digit. This is an example. Let's say we had the binary value of one, zero, zero, zero. We would look at this and we'd say there's nothing for this, nothing here, nothing here, but we have a value at one times two to the third, and we'd say that would equal eight. Let's add another digit, let's say we had one, zero, zero, one, one. We would say we have a one in the first digit, so that would be one and then we have a one in the second digit which represents two, so that would be two. We have a one in the 16 which would be 16, so we'd have 16 plus two plus one, what's that? Sixteen, eight, this is 19, is that right, 16 plus two is eighteen, plus one, 19. With this larger value here, here we have one, zero, zero, zero, one, one, one, one. If we were going to evaluate this number, what does this equal in binary, we'd say we have a one here and we have a one here, so one times two is two, and a one times four is four, and a one times eight is eight, and then we would have nothing here because zero times two to the fourth is zero. All of these numbers times zero would be zero. Then, we have one here which would be 128. If we added these up, let's see, what are we going to get? Sixteen, 20, 22, 23, three carry the two, and then we have and we'd have 143. This value in binary equates to 143, 10 there, in decimal.
If we wanted to go the other way, one of the ways you can do this, if we build a little table here and see if I can make this work. We'll make this eight bits, one, two, four, eight, 16, 32, 64, 128, and we're going to come back to this later in this chapter. If I had this value 143 and I wanted to convert that to decimal, this is one of the easiest ways I know of doing this. Let's put out one more here. This 256, you'll why in a moment. If I had this value 143 and I want to convert it to a binary value. First thing, I'm looking at my table of number here. Would I have this value 256 to represent 143? Obviously, if I have the one right here then it's going to be more than that [inaudible 0:09:51], so would not have it. The next question is would I have 128 and the answer is yes. I put a one here, and then I would take 143 and I have represented 128, so let's subtract 128. Let's see, we'll go with three here and we'll make this a 10, eight from 13 is what, five, and two from three is one, and we have 15 left over. We would not have a 64 or a 32 or a 16, but we would have an eight, so put an eight here and then we'll take 15 minus eight and that gives us seven. We would have a four, so we'll take the four, we'll subtract three, and so we see a two and a one, so this would give us the three. One, zero, zero, zero, one, one, one, one, that would give us our value.
One thing that we can do is when we're getting started on binary it's often a good idea to check yourself with a calculator. Let's pull up our little calculator. We can do binary with this, by the way. Let's click on the little binary button here. You notice now we only have a one and a zero. Let's click in that value. I would say one, zero, zero, zero, one, one, one, one, and then if we click on the decimal button it will convert that and we see that it is, in fact, 143. I encourage you when you are beginning to play with binary values to check yourself out with the calculator just to ensure that you're doing correctly. Windows also has an excellent, if you go to the scientific mode in Windows with the calculator built into Windows you can do this with great ease.
Binary numbers allow only two digits and could be obvious by now. We only have zeroes and ones. A binary digit is called a bit, and if we have eight of them in a row we call that a byte. An eight-bit digit would be, this is an example of an eight-bit digit. This would technically be called a byte. Microprocessors work with a variety of bit widths including four, eight, 16, 32, 64, 128 and more. We probably won't be dealing with much than eight in this class. It gets very cumbersome when you start dealing with 16, 32, 42 bits, especially when you're trying to calculate what is that in binary.
The radix point separates the integer from the fractional portion of the number, so in this case, this would be the one point right here, and then if we added more bits that would represent a decimal. For example, you had 128. 2 or something. We're going to be dealing with whole values, so we won't be dealing with it, but if we say the radix we're talking about this point right here.
Counting in binary is very simple and follows the same rules as decimal numbers. In decimal, we count by incrementing the least significant digit to the next highest digit value. It works the same way with binary numbers except the highest digit value is one. The table to the right counts to ten using four bits of binary. The way you would do this and this would be with four bits, we would start out with zero, and then we would go one, two, three, and this looks a bit different. This would be four, five, six, and then one, one, one, would be seven, and then if we add one to this, then we go one, zero, zero, so that would be eight, nine, 10, 11, 12, 13, 14, and 15. We would say one, two, three four, five, six, seven, eight, nine, and we could say 10 here. We're going to be looking at another system called hex. If we're looking at hex we could call this ten, but we're going to say A, and then B, C, D, E, and F. The F here would be, excuse me, not one, one, it should be one, one, one, one, right here, excuse me. The F would be the value for 15. Fifteen, by the way, is the largest number that you can represent with four bits and that would be represented, if it was hex, it would be by F. If we wanted to go to 16, note we'd need another bit, so that would go out here to one, zero, zero, zero, zero.
We have introduced this wonderful system we call binary. We counted in binary. We looked at the concept of a bit and a byte, then we did some converting of binary to decimal and decimal back to the binary. We will be playing with that quite a bit in the sections that follow. We did some comparison of the characteristics of binary and decimal.
This concludes the first part of section of 15.