Arama butonu
Bu konudaki kullanıcılar: 1 misafir
1
Cevap
1097
Tıklama
0
Öne Çıkarma
Arkadaşlar Ödeve Yardımcı Olabilir misiniz ?
D
10 yıl
Yüzbaşı
Konu Sahibi

Write a program that takes a 16-bit binary number as input and produces an instruction as output. The input binary number is the instruction that is stored in the IR(Instruction Register). You should give offset or immediate values in decimal, you should consider negative values, too. All 16 instructions are not included, 9 instructions listed below will be implemented. Assume initial value of PC is 1300 – in decimal, for you to calculate the address values easily.
You can work in groups of two, one group member should submit the source code. Example:
Enter the binary value in IR: 0101001111000010
ANDR1R7R2
R1=R7ANDR2
How to produce output:
Encode 0101001111000010.
First four bits, IR[15..12]:0101-> AND operation IR[11..9]: 001-> R1
IR[8..6]: 111-> R7
IR[5]=0, use register
IR[2..0]: 010-> R2
Instructions and their encodings:
ADD Instruction:
0001 Dst Src1 000 Src2
0001 Dst Src1 1 Immediate5
Branch Instruction:
0000 n z p PCoffset9
Output: ADD Dst Src1 Src2 Dst=Src1 + Src2
Output: ADD Dst Src1 Immediate value (in decimal) Dst=Src1 + Immediate value (in decimal)
Output: BR PCoffset (in decimal) PC= PCoffset (in decimal)
Jump Instruction:
1100 000 Base 000000
Load Instruction:
0010 Dst PCoffset9
Load Immediate Instruction:
1010 Dst PCoffset9
Load Register Instruction:
0110 Dst Base Offset6
Store Instruction:
0011 Src PCoffset9
Store Immediate Instruction:
1011 Src PCoffset9
Store Register Instruction:
0111 Src Base Offset6
Output: JMP BaseRegister PC= BaseRegister
Output: LD Dst M[PC+PCoffset9] Dst = M[PC+PCoffset9]
Output: LD Dst M[M[PC+PCoffset9]] Dst = M[M[PC+PCoffset9]]
Output: LDR Dst M[Base+Offset6] Dst = M[Base+Offset6]
Output: ST Src M[PC+PCoffset9] M[PC+PCoffset9]=Src
Output: ST Src M[M[PC+PCoffset9]] M[M[PC+PCoffset9]] = Src
Output: STR Src M[Base+Offset6] M[Base+Offset6] = Src

DH forumlarında vakit geçirmekten keyif alıyor gibisin ancak giriş yapmadığını görüyoruz.

Üye olduğunda özel mesaj gönderebilir, beğendiğin konuları favorilerine ekleyip takibe alabilir ve daha önce gezdiğin konulara hızlıca erişebilirsin.

Üye Ol Şimdi Değil





< Bu mesaj bu kişi tarafından değiştirildi death44 -- 28 Aralık 2014; 21:17:25 >

D
10 yıl
Yüzbaşı
Konu Sahibi

arkadaşlar ?



DH Mobil uygulaması ile devam edin. Mobil tarayıcınız ile mümkün olanların yanı sıra, birçok yeni ve faydalı özelliğe erişin. Gizle ve güncelleme çıkana kadar tekrar gösterme.