Thumbnail for Introduction to 8085 Microprocessor (μP) by Neso Academy

Introduction to 8085 Microprocessor (μP)

Neso Academy

20m 57s2,985 words~15 min read
Auto-Generated

[0:06]Hello everyone and welcome to the chapter fundamentals of 8085 microprocessor. So this is the first session of our new chapter and in this session we will be introduced to the 8085 microprocessor. So without any further ado, let's get to learning. Coming to the topic that we are going to cover today, today we will try to understand what is the word length of microprocessor. So the word length of a microprocessor is the size of data which the microprocessor can handle at once. If you remember when we were learning about the evolution of microprocessor, we learned that in 1971, as a member of the Intel 4000 family, 4004, that is the first microprocessor was introduced. Now if you remember, the word length of this was 4-bit. Now what is meant by that?

[1:03]The Intel 4004 microprocessor could handle 4 bits of data at once. That is, it can take a chunk of 4 bit as input. It can process that 4 bit chunk, also it can generate a 4 bit output. Now since the word length of Intel 4004 was 4 bit, therefore, it can perform 4 bit additions. Now in the previous session, we have seen the truth table for addition. Using this logic, Intel 4004, since it has the word length of 4 bit, could perform 4 bit addition. So clearly, if we feed the origin as 1001, and if we also feed the addent 0101, Intel 4004 could perform the addition. Let's now quickly perform the addition for it. 1+1 is supposed to generate the sum as 0 and the carry as 1. So we are going to have the sum as 0. Now what will be done with the carry? Well, the place value of these two bits is 2 raised to the power 0. And the result which is just generated by performing the addition between these two is actually 10, that is, a two-bit number. So the carry will be added with the bits in the 2 raised to the power one's place. So, adding 1 with 0, we will get 1. Also if we again add that 1 with 0, we will receive the sum as 1. Isn't it? So no carry, only the sum as 1. Because we are adding 1 with 0 and that to twice. Let's move on to the next unit, 0+1, we are supposed to get the result as 1. Right? Finally adding 1 with 0, we will again get the result as 1. Let's now check whether we have performed the addition correctly or not. And for that, we will be needing the place values. Now if you notice, the orgent, addent and also the result all are of 4 bits. Now for 4 bits, what will be the place values? Well, 1, 2, 4 and 8. To be precise, 2 raised to the power 0, that is 1, 2 raised to the power 1, that is 2, 2 squared, that is 4, and finally 2 cubed, that is 8. Now considering these words, what is the decimal equivalent value of the origin? Well, 8+1, that is 9. What about the addent? 4+1, that is 5. Let's move on to the result now. 8+4, that is 12, +2, will give us 14. And yes, it is correct, because 9+5 is 14.

[3:36]Now focus on the weights. With these weights, we can only represent unsigned numbers. So these are used for unsigned representation. Now think about it, if we talk about unsigned representation, we are going to use the place values 1, 2, 4 and 8. To be precise, 2 raised to the power 0, 2 raised to the power 1, 2 squared and 2 cubed. Now with 4 bits, how many sequences can we have? Well, we will begin with 0000, then 0001, so on and at last we will have 1111, that is, from 4 zeros to 4 ones. Now if we also consider the equivalent decimal values, 0000 is 0, then we will have 1, 2, 3, 4, 5 and so on, and the last value that is all ones will be 15. So using 4 bits, we can represent the values from 0 to 15. And all of these are positive values, that is, unsigned. Now from this particular list, can you figure out the least number? Well it is 0, right? So if we are talking about the range, with 4 bits, with unsigned representation, that is, using these place values, the least number that we can have is 0. Now what is the max number? It is 15. And how did we get it? We got it by placing all ones underneath these place values. Now for 4 bits, I already have told you multiple times, what are the actual place values? 2 raised to the power 0, 2 raised to the power 1, 2 squared, 2 cubed. Now think about the next place. If we had that place, what would have been the place value? 2 raised to the power 4, right? And what is 2 raised to the power 4? It is 16. And we got the maximum number in this list as 15. That is, 1 less than the next place value. So in order to define the range from the least value which is 0, we can have the max value, there is 2 raised to the power 4 - 1. Or in other words, 16-1, there is 15. Now you could ask me, why we are using this particular notation? Why can't we write 15 instead? Well, we can, there is nothing wrong about it, but it's a generalized formula. Why? Because in case of 5 bits, if we just place 5 in this place, we will have the maximum number of 5 bits using unsigned representation. And it's also meaningful, since we are using 4 bits, so we will only have to place the number of bits in here. Is it clear? So this is the range for 4 bit numbers using unsigned representation. Now focus on the range. It is 0 to 2 raised to the power 4 - 1. And we are talking about the unsigned representation. So if we talk about the number line, we are having the range from 0 to 15. And all these 16 numbers we are representing using the binary sequences starting from 0000, 0001 till all ones, that is, 4 ones. So the Intel 4004, since it has the word length of 4 bit, it can perform unsigned additions of two 4 bit numbers which will involve both the orgent and the addent from this particular list. Additionally, the result or the outcome will also have to be from this list only. For an instance, if we add 5, which in binary is 0101, with 10, there is 1010, the result is going to be 15 or 1111.

[7:33]And this can be done, since 1111 is a 4 bit binary number. And additions as such can be performed by Intel 4004 4 bit microprocessor. However, if we add 8 with 9, there is if we add 1000 with 1001, the result is going to be 17, which is not in this particular range. So this microprocessor is not going to produce that result. I hope the word length for addition is clear to you now. Like this, Intel 4004 can also perform subtraction. Now if you remember, when we learned about the subtraction in binary, we learned about two different approaches. One, the pen and paper method. And on the other hand, we learned about the machines approach. Therefore, when we are talking about subtraction performed by the 4004 4 bit microprocessor, it is going to take this approach under consideration, and specifically, it will perform the subtractions using two's complement technique. Let me show you one such subtraction, where we are going to have the menuend as 1001, and the subtract this time is 0101. Now as I told you earlier, we are not going to perform a-b, rather we are going to perform a+(-b). Because that's how using addition, we can also perform subtraction, which is followed in both ones and two's complement approaches. Now here, we have got the B, that is the subtract as 0101. Now in order to get the negative inverse, remember we are implementing two's complement, just like the 4004 4 bit microprocessor. So we will find out the B complement, that is the negative inverse of B. And for that, how to do it? If you remember the technique for two's complement, we are going to traverse the subtrend from the least significant bit, towards the most significant bit, and we will keep retaining the data until we encounter 1. Once we encounter 1, we will retain it as it is. However, the rest of the bits are going to be toggled, that is, 0 will become 1 and 1 is going to be 0. So finally, in case of the most significant bit, we toggled it to 1. So this is the two's complement of the subtract 0101. Now we have discussed about the conversion process, but I didn't tell you what is happening in here in reality. That is how it is -5, because if we consider 0101, it is 5. And negative inverse of that is supposed to be -5, right? Now we just have observed the place values in case of unsigned representation for 4 bit. Now since we are talking about these numbers, what is going to be the place values? In two's complement, the place values are 1, 2, 4, and -8. That is, apart from the most significant bit, all the remaining places have the same place values, only the most significant bit has the place value in negative. Now look at this. 1011, that is -8 +2, which will give us -6, +1, there is we are adding -6 with 1, we will get -5. Now you get it, how did we get -5? Well, the place value of the most significant bit is -8. Remember, this is for 4 bits. In case of 5 bits, apart from the most significant bit, the rest of the bits will have the same place values, just like unsigned representation. However, the most significant bit is going to have the place value -16, because we are talking about 5 bits then. Since we are dealing with 4 bits in here, for 4 bits, the most significant bit's place value is 8, that is 2 cubed, which in case of two's complement approach is -8 or -2 raised to the power 3 or -2 cubed. Now with -5, if we add 1001. Now here, do remember, this is in unsigned representation. So it is going to be 9, because here the place value is 8 only. So 8+1 is going to give us 9. Now let's observe, if we add these two, what is going to be the result? 1+1 will give us the sum as 0 and the carry is going to be 1. 1+0 is 1, then 1+1 will again give us the sum as 0 and the carry is going to be 1. Now adding 1 with all these zeros, we will receive the sum as 1. Now what about the most significant bits? 1+1 will give us 10. Remember, we are performing the subtraction in two's complement. Therefore, whenever the carry is generated, we are going to discard it. Now consider the result, it is 0100. What is the place value of this one? It is 4. And yes, from 9 if we subtract 5, we are getting 4. However, we didn't perform subtraction this time. Rather, we added 9 with -5 and got the difference as 4. Now let's focus on the negative inverse. We got this value -5, using signed representation. Now in case of signed representation, since we are talking about 4 bits, the place values are going to be 1, 2, 4, -8. Remember, whenever we are talking about signed representation, whatever the number of bits may be, the most significant bit will always have the place value in negative. Now just for a moment, forget about these signs. Just think about it, we are using 4 bits. Now with 4 bits, how many binary sequences can we have? Well, starting from all zeros, till all ones, that is, 16 different sequences. Let's now try to find out the equivalent decimal numbers. Although this time we are going to consider these place values. Now if you notice these patterns, till this particular point, we haven't placed 1 in the most significant bit's place. So till this point, the decimal equivalents will be the same as we had in case of unsigned numbers. That is from 0 to 7. Now once we have placed 1 in the most significant bit's place of the signed representation, considering the place value, what is going to be the decimal equivalent? Well, -8, isn't it? Now what about the next sequence? -8+1, there is -7. Focus on the next sequence, -8+2, there is -6. Then -8+2, there is -6, +1, there is -5, which we already used, didn't we? Now what about the next sequence? -8+4, there is -4. Then -8+4, there is -4, and with -4 if we add 1, we will get -3. Focus on the next sequence, -8+4, there is -4, +2, there is -2. Now what about the last sequence? 1111. -8+7, because 3 ones is 7, right? There is -1. Now from all these decimal values, can you figure out the minimum and the maximum values? Well, the minimum value is -8, right? Now what is the maximum value? It is 7, there is +7 or positive 7. So clearly, with the signed representation of 4 bits, we can represent from -8 till +7. Now what is -8? This is actually -2 cubed. However, since we are considering 4 bits, we can also state it as -2 raised to the power 4-1. Notice, -2 cubed. 4-1 is 3. So from -2 raised to the power 4-1, that is -8, using 4 bit sign representation, we could represent till the maximum value that is 7. And how did we get this? We got this by adding all these ones place values. Now what is 7? It is 1 less than 8. So we could also write 7 as 2 raised to the power 4-1 - 1, there is 2 cubed or 8-1, that is 7. So this is the range for 4 bit sign representation. Now we just also have seen the unsigned representations range. It was from 0 to 15. And we used the sequence from all zeros, there is 4 zeros to 4 ones to represent this particular range. Now when we are talking about the signed representation, here the most significant bits they represent the negative wattage. So the range is not going to be this anymore. Rather, we will have -8, -7, -6, -5, -4, -3, -2, -1. Now if you notice this particular line, this is wrong from our perspective. Because we deal in decimal number systems, right? So if we want to represent the range, that is from -2 raised to the power 4-1, to 2 raised to the power 4-1 - 1, we should rearrange this. That is -2 raised to the power 4-1 or -2 cubed or -8, and 2 raised to the power 4-1 - 1, that is 2 cubed -1 or 8-1, that is 7. Now notice, the decimal numbers are organized, that is, we are having the least value as -8, and the maximum value as +7. However, now we don't have the order in the binary bits sequences. So remember, Intel 4004 4 bit microprocessor, if it used sign representation, could deal with the numbers starting from -8, that is 1000, till the positive number +7, that is 0111. And that's the beauty of the word length of 4 bit. So to sum it up, we could say Intel 4004 4 bit muP, in unsigned representation, could use the numbers starting from 0 till 2 raised to the power 4-1, that is, from 0 to 15, 16-1, that is 15. Now coming to sign representation, it could deal with the values from -2 raised to the power 4-1 till 2 raised to the power 4-1 - 1, that is from -2 cubed or -8 till 2 cubed -1 or +7. Remember this, all these exponents are 4, because the word length of 4004 was 4 bit. Now during the evolution of microprocessors, we have learned in 1972, Intel introduced the next microprocessor, that is, Intel 8008. In 1974 it introduced Intel 8080, and then in 1977 Intel came up with Intel 8085. Notice, this is an 8-bit microprocessor. In other words, it has the word length of 8 bit. So if we follow this particular format, we could say Intel 8085, if we talk about the unsigned representation, can deal with the range of numbers from 0 to 2 raised to the power 8-1. And similarly, following this, for the 8 bit microprocessor Intel 8085, we can also say, for sign representation, it can deal with the numbers within the range -2 raised to the power 8-1 to 2 raised to the power 8-1 - 1.

[20:21]In other words, Intel 8085 can deal with 8 bits of data at once. Also, feel free to write down the ranges in decimal for these two representations in the comment section. So in this session, we covered the topic word length of microprocessor. Alright people, that will be all for this session. In the next session, we are going to learn about the pins of 8085 microprocessor. So I hope to see you in the next one. Thank you all for watching.

Need another transcript?

Paste any YouTube URL to get a clean transcript in seconds.

Get a Transcript