Processors

Instruction Encoding

This topic is intended to make a better understanding of the microprocessor instructions which can very helpful during the course of an interview of any embedded company. In this topic we’ll see how instruction opcodes are decided and how they vary with no of instructions and instruction format. This a very easy topic and everyone must go though it.

In general an instruction has 2 components:

  1. Op-code field
  2. Address field

Op-code field tells how data is to manipulated and address field tells us about the address of different data. Address field may contain zero or one or two or more addresses. Consider the instruction

  Mov                       A, B

Opcode              Address

Field                      Field

Depending on the different addressing modes one can have different instruction formats:

  1. Zero address instructions
  2. One address instructions
  3. Two address instructions

Size of instruction word is decided by the designer depending upon the no of instructions required and instruction’s format. Suppose we have 8 bit instruction word. We’ll see how many instructions we can have and Address is of 3 bits.

Zero address instructions:

As there is no address to be specified so we can use all 8 bits for opcode hence we can have 28=256 opcodes and 2=256 instructions with no address fields.

One address instructions:

As we have to specify one 3 bit address field so we’ll use 3 bits for address and rest 5 bits for opcodes. Hence we can have 25=32 opcodes and 2=32 instructions with 1 address fields.

Opcode                                                add1                     

            p4 p3 p2 p1p0                                          

                 00000                                   a2a1a0                   

                  00001                                  a2a1a0                             

                  00010                                  a2a1a0                             

                  00011                                  a2a1a0     

 ………

                 ………

11111                                    a2a1a0     

Two address instructions:

Here we have to specify 2 3-bit address fields so we use 6 bits for the address and rest 2 bits for opcode. So we can have 22=4 opcodes and hence 22=4 instructions with 2 address fields.

 And we can assign different opcodes to different instructions which have the similar address fields.

Now if we reduce the no of two address instructions from 4 to 3 then we can have 8 more one addresss instructions as

And now if we reduce no. of one address instructions from 8 to 7 then we can accommodate 8 more zero address instructions.

So we can have 3 two address instructions, 7 one address instructions and 8 zero address instructions with total 8 bit of instruction word.

73 Replies to “Instruction Encoding

  1. I discovered your blog website on google and examine a number of of your early posts. Proceed to keep up the very good operate. I just further up your RSS feed to my MSN Information Reader. In search of forward to reading more from you afterward!…

  2. Une fois la plupart des téléphones mobiles éteints, la restriction relative à la saisie d’un mot de passe incorrect sera levée. À ce stade, vous pouvez accéder au système par empreinte digitale, reconnaissance faciale, etc.

  3. I’ll right away grasp your rss feed as I can not to find your email subscription link or newsletter service. Do you’ve any? Kindly let me recognise in order that I may just subscribe. Thanks.

  4. I think that is among the such a lot significant information for me. And i’m satisfied reading your article. However wanna statement on few basic things, The web site taste is great, the articles is in reality great : D. Excellent job, cheers

  5. Excellent post but I was wanting to know if you could write a litte more on this topic? I’d be very grateful if you could elaborate a little bit more. Thank you!

  6. Excellent beat ! I wish to apprentice even as you amend your web site, how could i subscribe for a blog website? The account helped me a appropriate deal. I had been tiny bit familiar of this your broadcast provided brilliant transparent idea

  7. I am often to blogging and i really appreciate your content. The article has really peaks my interest. I am going to bookmark your site and keep checking for new information.

  8. Hiya! I know this is kinda off topic but I’d figured I’d ask. Would you be interested in exchanging links or maybe guest authoring a blog post or vice-versa? My website discusses a lot of the same topics as yours and I think we could greatly benefit from each other. If you are interested feel free to send me an e-mail. I look forward to hearing from you! Superb blog by the way!

  9. I’m curious to find out what blog system you happen to be utilizing? I’m experiencing some small security problems with my latest website and I would like to find something more secure. Do you have any recommendations?

  10. With havin so much content and articles do you ever run into any issues of plagorism or copyright infringement? My site has a lot of completely unique content I’ve either written myself or outsourced but it appears a lot of it is popping it up all over the internet without my authorization. Do you know any methods to help prevent content from being ripped off? I’d truly appreciate it.

  11. Java Burn is the world’s first and only 100 safe and proprietary formula designed to boost the speed and efficiency of your metabolism by mixing with the natural ingredients in coffee.

  12. Hi there! I simply wish to give an enormous thumbs up for the great information you will have right here on this post. I will probably be coming again to your weblog for more soon.

  13. You actually make it appear so easy along with your presentation but I to find this topic to be really something which I think I would never understand. It seems too complex and very large for me. I am having a look forward for your subsequent post, I¦ll attempt to get the hang of it!

  14. What is Gluco6 Supplement? Gluco6 is a blend of doctor-formulated ingredients promising to help users develop healthy blood sugar ranges.

  15. What i don’t understood is in fact how you are not actually a lot more smartly-favored than you might be now. You’re so intelligent. You realize thus considerably with regards to this matter, produced me personally believe it from so many various angles. Its like women and men aren’t involved except it’s one thing to do with Woman gaga! Your individual stuffs outstanding. All the time take care of it up!

  16. I do not even know how I ended up here, but I thought this post was good. I don’t know who you are but definitely you’re going to a famous blogger if you are not already 😉 Cheers!

  17. What i do not realize is actually how you are no longer really a lot more neatly-preferred than you may be now. You are very intelligent. You realize thus considerably relating to this matter, produced me for my part consider it from so many numerous angles. Its like women and men are not interested until it’s one thing to do with Girl gaga! Your personal stuffs outstanding. All the time take care of it up!

  18. What’s Taking place i am new to this, I stumbled upon this I have found It absolutely helpful and it has aided me out loads. I am hoping to give a contribution & aid other customers like its aided me. Good job.

  19. I do agree with all of the ideas you’ve presented in your post. They are very convincing and will definitely work. Still, the posts are very short for novices. Could you please extend them a little from next time? Thanks for the post.

  20. Hi, I think your site might be having browser compatibility issues. When I look at your website in Safari, it looks fine but when opening in Internet Explorer, it has some overlapping. I just wanted to give you a quick heads up! Other then that, fantastic blog!

  21. F*ckin’ tremendous issues here. I am very glad to peer your post. Thank you a lot and i’m having a look forward to contact you. Will you please drop me a mail?

  22. I’ve been browsing online more than 3 hours today, yet I never found any interesting article like yours. It is pretty worth enough for me. Personally, if all web owners and bloggers made good content as you did, the net will be a lot more useful than ever before.

  23. It¦s really a nice and useful piece of info. I¦m glad that you just shared this helpful info with us. Please keep us informed like this. Thank you for sharing.

  24. Hi! I could have sworn I’ve been to this site before but after browsing through some of the post I realized it’s new to me. Nonetheless, I’m definitely delighted I found it and I’ll be book-marking and checking back often!

  25. What is CogniCare Pro? CogniCare Pro is 100 natural and safe to take a cognitive support supplement that helps boost your memory power. This supplement works greatly for anyone of any age and without side effects

  26. This design is incredible! You definitely know how to keep a reader amused. Between your wit and your videos, I was almost moved to start my own blog (well, almost…HaHa!) Wonderful job. I really enjoyed what you had to say, and more than that, how you presented it. Too cool!

  27. I want to show some appreciation to you for bailing me out of such a scenario. Just after surfing through the internet and obtaining tips which are not productive, I figured my entire life was well over. Existing devoid of the answers to the difficulties you have resolved by way of your post is a critical case, and those which might have badly damaged my career if I hadn’t discovered your website. Your main mastery and kindness in maneuvering the whole lot was tremendous. I am not sure what I would have done if I had not come across such a step like this. I can at this moment relish my future. Thanks so much for your impressive and amazing guide. I will not be reluctant to refer the blog to any individual who would need direction about this subject.

  28. Pingback: alexistogel link
  29. Hi, i think that i noticed you visited my website so i came to “go back the prefer”.I am attempting to in finding issues to enhance my website!I assume its ok to use a few of your ideas!!

  30. Hello There. I found your blog using msn. This is a really well written article. I will be sure to bookmark it and return to read more of your useful info. Thanks for the post. I’ll definitely return.

  31. Hello, Neat post. There’s an issue together with your site in web explorer, could test this?K IE still is the marketplace chief and a huge portion of folks will leave out your excellent writing because of this problem.

  32. Along with everything which appears to be building within this subject matter, all your points of view happen to be fairly exciting. However, I beg your pardon, because I can not subscribe to your entire idea, all be it radical none the less. It seems to me that your remarks are generally not totally justified and in simple fact you are yourself not even thoroughly confident of your argument. In any case I did enjoy reading through it.

  33. Heya i am for the first time here. I found this board and I find It really useful & it helped me out much. I hope to give something back and help others like you aided me.

  34. Hello! I know this is kinda off topic nevertheless I’d figured I’d ask. Would you be interested in trading links or maybe guest authoring a blog post or vice-versa? My site discusses a lot of the same subjects as yours and I think we could greatly benefit from each other. If you are interested feel free to shoot me an email. I look forward to hearing from you! Excellent blog by the way!

  35. Fitspresso is a brand-new natural weight loss aid designed to work on the root cause of excess and unexplained weight gain. The supplement uses an advanced blend of vitamins, minerals, and antioxidants to support healthy weight loss by targeting the fat cells’ circadian rhythm

  36. sugar defender drops is a potent and effective way to support healthy blood sugar levels throughout the day. As your body adjusts to the ingredients, you’ll notice reduced hunger, increased energy, and improved blood sugar readings.

Leave a Reply

Your email address will not be published. Required fields are marked *