in CO and Architecture retagged by
376 views
0 votes
0 votes

Why 50 * 3 and not 50+3 ?

Does every Byte requires different instruction ?

 

in CO and Architecture retagged by
376 views

2 Comments

@neeraj33negi @Navneet Kalra 

thanx but my doubt was different. please read the question heading again.

0
0
it depends upon the instruction length if your instruction length comes to 1 byte then yes

if it comes to 2 byte then every instruction requires 2 bytes

reguarding requirement....every instruction will have opcodes and other memory or address references then we will have to find length of instruction and then multiply length with total instructions
0
0

2 Answers

2 votes
2 votes
  • Bits required for registers = log( 24 ) = 5bits
     
  • Bits required for instruction = log( 25 ) = 5bits
     
  • Instruction size = 5+5+5+5 = 20bits
    since memory is byte addressable, every instruction will be stored in ceil(20/8) = 3 bytes
     
  • number of instructions in program = 50
     
  • memory required = 50*3 = 150bytes
0 votes
0 votes
See each instruction is require 5 bits for opcode ,two 5 bits for source registers and one 5 bit for destination register so making a total of 20 bits which means we need 3 bytes for every instruction now program length is of 50 instructions making a total of 50*3=150 bytes

Related questions

0 votes
0 votes
0 answers
1