100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

ECEN 350 PRELAB QUIZZES QUESTIONS

Rating
-
Sold
-
Pages
10
Grade
A+
Uploaded on
14-12-2025
Written in
2025/2026

ECEN 350 PRELAB QUIZZES QUESTIONS

Institution
ECEN 350
Course
ECEN 350









Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
ECEN 350
Course
ECEN 350

Document information

Uploaded on
December 14, 2025
Number of pages
10
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

ECEN 350 PRELAB QUIZZES QUESTIONS


Write down the representation of R- and I-format instructions. Explain the purpose of
each field in the instruction.

(fill in the large text box) - Answer -R-Format Instructions: opcode (6 bits), Rm (5 bits),
Shamt (6 bits), Rn (5 bits), Rd (5 bits)

opcode: the operation instruction
Rm: Source register, but the second operand
Shamt: Shift amount
Rn: Source register, but the first operand
Rd: Destination Register

EXAMPLE:ADD X1, X2, X3Translated as: X1 (Rd) = X2 (Rn) + X3 (Rm)
opcode: ADD = 10001011000 in binary
Rm: X3 = 00011 (3 in binary)
Shamt: 0 = 000000
Rn: X2 = 00010 (2 in binary)
Rd: X1 = 00001 (1 in binary)
Put it all together: 10001011000 00011 000000 00010 00001



I-format Instructions: opcode (10 bits), immediate (12 bits), Rn (5 bits), Rd (5 bits)

opcode: the operation instruction
immediate: the constant being added in the instruction
Rn: Source register
Rd: Destination Register

EXAMPLE: ADD X0, X0, #0x64
(Because there is a constant, we are using ADDI)
opcode: ADDI = 1001000100
immediate/"constant": #0x64 (this is in hex) = 000001100100
Rn: X0 = 00000
Rd: X0 = 00000
Put it all together: 1001000100 000001100100 00000 00000

For each of the following instructions, list the instruction format type:
SUB X1, X2, #4:
AND X1, X2, X3:
CBZ:
B:

, LDUR:
STURB:
(note: you will likely want to use the Green Sheet in your book to answer this)

(fill in SIX blanks) - Answer -I
R
CB
B
D
D

Write the binary encoding for the following instructions. Indicate the different fields in the
encoding by placing a space between them.
ADD X3,X2,X5:
ADD X3, X2, #40:
SUB X3,X5, X3:

(fill in THREE blanks) - Answer -10001011000 00101 000000 00010 00011

1001000100 000000101000 00010 00011

11001011000 00011 000000 00101 00011

Translate the following high-level code into assembly language.
Assume variables a − c are held in registers X0 - X2 and f − j are in X19 - X23

a=b-c;f=(g+h)-(i+j);

(fill in the large text box) - Answer -GIVENS:
a = X0; b = X1; c = X2
f = X19; g = X20; h = X21; i = X22; j = X23

SUB X0, X1, X2 (a = b - c)
ADD X1, X20, X21 (b = g + h)
ADD X2, X22, X23 (c = i + j)
SUB X19, X1, X2 (f = b - c)

Write an assembly program to swap the contents of 2 variables stored in registers
X4,and X5. If you need an extra register you may use X1.

(fill in the large text box) - Answer -EOR X1, X4, X5;
EOR X5, X1, X5;
EOR X4, X1, X5;

WORK:
if x1=00001, x4=00100, x5=00101:

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
GEEKA YALA UNIVERSITY
View profile
Follow You need to be logged in order to follow users or courses
Sold
1996
Member since
3 year
Number of followers
1445
Documents
46187
Last sold
2 days ago

3.8

341 reviews

5
169
4
61
3
44
2
16
1
51

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions