Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old May 15th, 2008, 12:22 PM   #1
nannu
Newbie
 
Join Date: Apr 2008
Posts: 19
Rep Power: 0 nannu is on a distinguished road
MARIE a sample computer ARCH

Hey guys, Im stydying for the final in the class. I have posted for other things. But one of the questions for the review is:
QUESTION:
In a computer instruction format, the instruction length is 11 bits and the size of an address field is 4 bits. Is it possible to have
5 2-address instructions
45 1-address instructions
32 0-address instructions

EXAMPLE:
For the sample I looked at, it shows that it is possible to have
15 instructions with 3 addresses
14 instructions with 2 addresses
31 instruction with 2 addresses
16 instructions with 0 addresses

0000 R1 R2 R3
<----- 15 3 address code
1110 R1 R2 R3

1111 0000 R1 R2
<----- 14 2 address codes
1111 1101 R1 R2

The book tells that there are two ways to set this up.
| | | | | | | | | | | | | | | | | | | | | | | | | |
opcode address 1 address 2 address 3
or
| | | | | | | | | | | | | | | | | | | | | |
opcode address 1

How can I understand the part in red to be able to answer the review question that I posted above. What are the two examples saying.
Thanks in advance
nannu is offline   Reply With Quote
Old May 16th, 2008, 3:26 PM   #2
Seif
Hobbyist Programmer
 
Seif's Avatar
 
Join Date: Jan 2006
Location: UK
Posts: 215
Rep Power: 3 Seif is on a distinguished road
Re: MARIE a sample computer ARCH

This is not a C++ problem and really does not belong here.

I'm not familiar with Marie Architecture but at a quick glance it seems to have a good, simple instruction set architecture for beginners to get to grips with.

have a read of this:

http://www.mans.eun.eg/faceng/arabic...S/PDF3/2.2.pdf

you should have a better understanding from that.
Seif is offline   Reply With Quote
Old May 17th, 2008, 11:17 AM   #3
Wizard1988
Professional Programmer
 
Wizard1988's Avatar
 
Join Date: Oct 2005
Location: Chitown
Posts: 417
Rep Power: 4 Wizard1988 is on a distinguished road
Send a message via AIM to Wizard1988
Re: MARIE a sample computer ARCH

From what I understand this architecture is using fixed length instructions, which are 11 bits long. An address field is four bits long, this means it would be possible to address 2^4 different registers with one address field.

Now here is what you need to understand, the opcode tells you the actual operation and the address fields tell you what registers are being used in the operation (some of those opcodes could be memory operations but that isn't what the question is asking...)

So you have 11 bits that you can use, if you take four bits of that and assign it to be an address you have 7 bits left. The remaining seven bits allow you to encode up to 2^7 different operations (with one address).

If you have two addresses in the instruction then you have 11 - ( 2 *4) bits left for the opcode. meaning that you can now encode only 2^3 different operations.

Hopefully this clears it up a bit.
__________________
JG-Webdesign
Wizard1988 is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Insane computer problem uman Coder's Corner Lounge 10 Nov 21st, 2007 10:55 AM
Trying to find a computer science job.. csrocker101 Coder's Corner Lounge 12 Jul 24th, 2007 8:15 AM
Build Computer for Low Price PhilBon Coder's Corner Lounge 4 Jun 11th, 2007 11:27 AM
what is computer programming? pal Coder's Corner Lounge 14 Dec 9th, 2005 10:22 AM
Computer - Freezing coldDeath Coder's Corner Lounge 37 Nov 23rd, 2005 9:35 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 6:23 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC