EE234_hw02_Sol_24S
.docx
keyboard_arrow_up
School
Western Washington University *
*We aren’t endorsed by this school
Course
234
Subject
Electrical Engineering
Date
Apr 3, 2024
Type
docx
Pages
3
Uploaded by zerogaming0723
EE234 Homework 2
Due
: 02/02/2024 (Thursday)
Save your answer in word format
and using the file name “
EE234_HW2_LastName_FirstName
”
1. Write an instruction sequence to subtract the 16-bit value stored at program memory 0x1050~0x1051 from the sum of two 16-bit values stored at program memory 0x1060~0x1061 and 0x1070~0x1071. Store the result at data memory 0x2000~0x2001.
Solution:
ldi
ZL,0x60
ldi
ZH, 0x10
lpm
r0, Z+
lpm
r1, Z
ldi
ZL, 0x70
ldi
ZH, 0x10
lpm
r2, Z+
lpm
r3, Z
add
r0, r2
adc
r1, r3
ldi
ZL, 0x50
ldi
ZH, 0x10
lpm
r4, Z+
lpm
r5, Z
sub
r0, r4
sbc
r1, r5
sts
0x2000, r0
sts
0x2001, r1
2. Write an instruction sequence to multiply the 16-bit unsigned value stored
at program memory 0x1050~0x1051 and the 16-bit value stored in r5~r6 register pair and store the product in data memory from 0x2020~0x2023. Call the subroutine mul16U to perform the multiplication.
Solution:
ldi
ZL, 0x50
ldi
ZH, 0x10
lpm
r16, Z+
lpm
r17, Z
mov
r18, r5
mov
r19, r6
call
mul16U
sts
0x2020, r22
sts
0x2021, r23
sts
0x2022, r24
sts
0x2023, 0xr25 3. Write a program to read every element from an array in program memory (with the label sarr
), set bit 7, clear bit 6, and set bit 2, and then store the result in data memory (starting from 0x2000). The array elements are 8-bit. The array has 30 elements.
Solution:
.include <atxmega128A1Udef.inc>
.equ
sbMask = 0x84
.equ
cbMask = 0x40
.equ
NN = 30
.def
lpCnt = r19
.dseg
.org
0x2000
.byte
30
.cseg
.org
0x00
jmp
start
.org
0xFA
start: ldi
ZL, low(sarr << 1)
ldi
ZH, high(sarr << 1)
ldi
XL, 0
ldi
XH, 0x20
ldi
lpCnt, NN
clr
cnt
loop:
lpm
r16, Z+
sbr
r16, sbMask
cbr
r16, cbMask
st
X+, r16
dec
lpCnt
brne
loop
here:
jmp
here
sarr:
.db
0x11, 0x12, 0x13, 0x14, 0x15, ox16, 0x17, 0x18, 0x19, 0x20
.db
0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x30
.db
0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x40
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Related Questions
Question 1:
Use Indirect addressing to write a PIC24 assembly code that complements and
adds 5 and multiply by 2 to 1024 data bytes into the memory at starting address
Ox1000. The original data are stored in the memory starting from address 0x800.
it is an electrical engineering question . this is the full
information about the question!
arrow_forward
Write program to load the content of memory location 0x0700 into register R3 then set D6,D7 and complement D4,D5 for date in R3 then store the result in memory
location 0x0800 .
arrow_forward
Please answer in typing format
arrow_forward
question1:In a memory system, data is 16-bit wide. Break the information into bytes with their addresses using little endian and big-endian methods. Starting address is F800 and the data is: E0F2 0041
question2:What acknowledgment signals are there in I2C bus?
arrow_forward
To select the ROM the address lines A10-A9 should be:
A. 00
B. 01
C. 10
D.10
arrow_forward
6- Set BX to 4567H, CX to FEDCH and SP to A59FH, then run the instructions:
PUSH BX
PUSH CX
a. What is the new value of SP ?
b. Display the memory locations where you pushed the values of BX and CX in
the stack.
arrow_forward
(c)
Figure Q3(c)(i) shows a register and Figure Q3(c)(ii) shows the input waveforms
(CLOCK and Data in) to the circuit.
A1
A9
A10
A2
Function generator
A3
A11
A12
AS
A13
A6
A14
A7
A15
Data in
Bop.7)
ip.r
82p.7)
Logic analyser
U1
U2
U3
U4
UO
6.
1.
6
1
6
INVERTER
3
CLK
3 CLK
oCLK
CLK
5
K
K
5
K
K
4027
Clock
Function generator
Figure Q3(c)(i)
(i)
Determine the type of register as shown in Figure Q3(c)(i).
arrow_forward
Question in photo please ASAP Hand written also
thanks
arrow_forward
THE FOLLOWING QUESTION CONTAINS ALL THE REQUIREMENTS NEEDED.
arrow_forward
Solve correct please
arrow_forward
QUESTION 33
Use the schematic for our board to select the input signals on the I/O Memory selection hardware that are used to generate the ROMRD signal on our board.
WR
ROMSEL
O WR
10/M
O RD
O READY
O O
arrow_forward
Write assembly language program.
arrow_forward
Must be handwritten No AI based ANSWER
arrow_forward
Write a loop which fills all of data memory (0 to 255) with Use 8051 assembly language.
arrow_forward
1. Assume that the registers are 8-bit wide. Consider the following code:
MOV R1, #4A
MOV R2, #40
ADD R3, R1, R2
a) What will be the 8-bit result in Register R3 (in hex)?
b) What is the 8-bit result in Register R3 (as unsigned decimal)?
c) What is the 8-bit result in Register R3 (as signed decimal)?
d) What will be the value of the carry (C) bit?
arrow_forward
a) Convert the decimal number - 239 into a
signed binary number using
(1) sign-magnitude method (2) 1's
complement method (3) 2's complement
method
b) If the above decimal number is positive ,
that is + 239, then convert it to a signed
binary number using 1 's complement
method
c) Do the following binary subtraction:
101111111.01111-
001011010.10110
d)Explain Types of RAM?
arrow_forward
Let (BX)=100H, DI=200H, DS=1200H, SI=
FO02H, AX= 0105H, and the following
memory content. what is the content of SI
after executing the MOV SI, [DI+BX+7H]
instructions? *
Memory
Memory
address
content
12300
11
12301
AA
12302
EF
12303
80
12304
47
12305
8D
12306
5A
12307
92
12308
C5
SI = EF80H
SI = 80EFH
SI = 92C5H
SI = C592H
arrow_forward
Identify the contents of the registers, the memory location (C055H), and the flags as the following instructions are executed in 8085 microprocessor.
A
H
L
S
Z
CY
M(C055H)
LXIH, C055H
MVI M,8AH
MVI A,76H
ADD M
STA C055H
HLT
arrow_forward
. (A-)Hand trace the execution of the following program fragments showing what happens to the
flags and registers (AL, BL, CL) in each statement supposes that the flags are initially 0.
MOV BL, 03H
CF SF ZF OF PF
AF
ADD BL, 02H
SUB BL, 05H
MOV AL, 00H
DEC AL
XCHG AL, BL
arrow_forward
QO
dddd
Q1
clock
Given:
• Counter starts at decimal 9 when Q viewed as a 4-bit unsigned number (Q3 most significant bit)
What is the decimal value of Q (viewed as a 4-bit unsigned number) after four more clock “ticks"? Answer
arrow_forward
Plz solve within 30min I vill give definitely upvote and vill give positive feedback thank you sir
arrow_forward
Problem 4
1-13.* Convert the following binary numbers to their equivalent decimal
values.
(a) 110012
Show Procedure
(b) 1001.10012
(c) 10011011001.101102
arrow_forward
| Solve all parts. Will give thumb's up|
If you can't do all please don't attempt the questions.
arrow_forward
Digital Electronic
I need the answer in one hour please.
arrow_forward
Write a program to PUSH R0, R1, and R3 of Bank 0 onto the stack and POP them back into R5, R6, and R7 of Bank 3. Also, mention the value of SP register after every PUSH and POP operation.
this question is asked in microprocessor and microcontroller
arrow_forward
In the following instruction sequence, show the
resulting value of AL after highlighted comment, in
binary.
mov al,01101111b
and al,00101101b
; here
mov al,6Dh
and al,4Ah
mov al,00001111b
or al,61h
mov al,94h
xor al,37h
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
Related Questions
- Question 1: Use Indirect addressing to write a PIC24 assembly code that complements and adds 5 and multiply by 2 to 1024 data bytes into the memory at starting address Ox1000. The original data are stored in the memory starting from address 0x800. it is an electrical engineering question . this is the full information about the question!arrow_forwardWrite program to load the content of memory location 0x0700 into register R3 then set D6,D7 and complement D4,D5 for date in R3 then store the result in memory location 0x0800 .arrow_forwardPlease answer in typing formatarrow_forward
- question1:In a memory system, data is 16-bit wide. Break the information into bytes with their addresses using little endian and big-endian methods. Starting address is F800 and the data is: E0F2 0041 question2:What acknowledgment signals are there in I2C bus?arrow_forwardTo select the ROM the address lines A10-A9 should be: A. 00 B. 01 C. 10 D.10arrow_forward6- Set BX to 4567H, CX to FEDCH and SP to A59FH, then run the instructions: PUSH BX PUSH CX a. What is the new value of SP ? b. Display the memory locations where you pushed the values of BX and CX in the stack.arrow_forward
- (c) Figure Q3(c)(i) shows a register and Figure Q3(c)(ii) shows the input waveforms (CLOCK and Data in) to the circuit. A1 A9 A10 A2 Function generator A3 A11 A12 AS A13 A6 A14 A7 A15 Data in Bop.7) ip.r 82p.7) Logic analyser U1 U2 U3 U4 UO 6. 1. 6 1 6 INVERTER 3 CLK 3 CLK oCLK CLK 5 K K 5 K K 4027 Clock Function generator Figure Q3(c)(i) (i) Determine the type of register as shown in Figure Q3(c)(i).arrow_forwardQuestion in photo please ASAP Hand written also thanksarrow_forwardTHE FOLLOWING QUESTION CONTAINS ALL THE REQUIREMENTS NEEDED.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you