-2

Question:

For a 16 bit word with 6 bits for an opcode

  • How many different instructions could I fit into the instruction set?
  • What is the largest number that I could use as data?

Answer:

  • Number of instructions: 26 = 64
  • largest operand: 210 - 1 = 1023

Source

My question is how did they calculated 210 from 16 bit word?

2
  • 2^10-1 = 1023. There are 1024 possible values for 10-bit numbers, but since 0 is usually included, then we think of 10 bits as capable of representing 0 to 1023. Or, -512 to 511 if we have a signed 10-bit number. Commented Jul 19, 2016 at 23:56
  • Possible duplicate of How do we go from assembly to machine code(code generation) Commented Jul 20, 2016 at 6:32

1 Answer 1

4

If a number takes up 16 bits, and you use 6 of them for something, that leaves 10 bits.

4
  • Could you explain the difference between 16 bits and 16 bit word. Commented Jul 19, 2016 at 22:31
  • 2
    This is like asking "what is the difference between 'red' and 'a red cat'". A 16 bit word is a word that consists of 16 bits. Commented Jul 19, 2016 at 22:34
  • Oh so that means "word" is the the instruction set size. I didn't know that, I'm ignorant about machine level sorry for bad question. Commented Jul 19, 2016 at 22:38
  • 2
    We think of bytes as 8 bits now, but in the octal days some systems had 6 or 9 bits because it made sense then. They are all correctly called a byte. An x86 machine calls a word 16 bits, an arm calls a words 32 bits, doesnt necessarily have anything to do with their register nor instruction nor address bus sizes, just someone there decided to use that convention. Because of the different conventions we now sometimes have to use terms like 16 bit word and 32 bit word if there is not enough context to just say word or byte or double word. Commented Jul 21, 2016 at 1:59

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.