# 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

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

Field                      Field

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

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.

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.

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.

p4 p3 p2 p1p0

00000                                   a2a1a0

00001                                  a2a1a0

00010                                  a2a1a0

00011                                  a2a1a0

………

………

11111                                    a2a1a0

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.

## 58 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. You have noted very interesting points! ps nice site.

5. 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

6. 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!

7. Hi there are using WordPress for your site platform? I’m new to the blog world but I’m trying to get started and set up my own. Do you need any html coding knowledge to make your own blog? Any help would be really appreciated!

8. I think other website proprietors should take this website as an model, very clean and magnificent user genial style and design, let alone the content. You are an expert in this topic!

9. 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

10. Thanks for the post, can you make it so I receive an email sent to me whenever you make a new update?

11. 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.

12. SightCare is a vision enhancement aid made of eleven carefully curated science-backed supplements to provide overall vision wellness.

13. Renew: An OverviewRenew is a dietary supplement that is formulated to help in the weight loss process.

14. FitSpresso: What Is It? FitSpresso is a natural weight loss aid that targets the root cause of excess body fat.

15. 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!

16. 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?

17. 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.

18. 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.

19. magnificent issues altogether, you simply won a brand new reader. What would you suggest about your submit that you just made a few days ago? Any certain?

20. LeanBiome is a probiotic dietary supplement that’s packed with lean bacteria species that help support healthy weight loss.

21. 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.

22. 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!

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

24. 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!

25. 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!

26. 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!

27. 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.

28. 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.

29. Hey, you used to write fantastic, but the last few posts have been kinda boringK I miss your great writings. Past few posts are just a little out of track! come on!

30. 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!

31. 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?

32. Its excellent as your other articles : D, appreciate it for posting.

33. 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.

34. Would love to constantly get updated outstanding blog! .

35. I?¦ve recently started a website, the information you provide on this web site has helped me tremendously. Thank you for all of your time & work.

36. 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.

37. 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!

38. 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

39. 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!

40. I always was interested in this subject and still am, regards for posting.

43. Well I really enjoyed reading it. This tip offered by you is very constructive for accurate planning.

44. Hey There. I found your blog using msn. This is a really well written article. I’ll make sure to bookmark it and return to read more of your useful info. Thanks for the post. I’ll certainly comeback.

45. 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!!

46. This really answered my problem, thank you!

47. Your style is so unique compared to many other people. Thank you for publishing when you have the opportunity,Guess I will just make this bookmarked.2

48. I have recently started a site, the information you provide on this site has helped me greatly. Thank you for all of your time & work.

49. Perfect piece of work you have done, this internet site is really cool with wonderful info .

50. 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.

51. But wanna comment that you have a very decent site, I enjoy the style and design it really stands out.