Write a counting program in MIPS assembly. The program should print the first sixteen powers of 2 beginning with 2^0 with a space between each value. The output of the program should be exactly as follows: 1 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768 Additional requirements for this problem: You must use a logical shift operation in your implementation. You must use a loop (i.e., a conditional branch that causes program instructions to repeat).

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Write a counting program in MIPS assembly. The program should print the first sixteen powers of 2 beginning with 2^0 with a space between each value. The output of the program should be exactly as follows:

1 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768

Additional requirements for this problem: You must use a logical shift operation in your implementation. You must use a loop (i.e., a conditional branch that causes program instructions to repeat).

Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

How to add space in between each power of 2 printed by this mips assembly program.

The output currently is:

124816326412825651210242048409681921638432768

When it needs to be:

1 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768 

-------

main:
li $t0, 16
li $t1, 0
li $t3, 1
loop:
beq $t1, $t0, end
li $v0, 1
move $a0, $t3
syscall
sll $t3, $t3, 1  
addi $t1, $t1, 1
j loop 
end:
li $v0, 10
syscall
jr $ra 

Solution
Bartleby Expert
SEE SOLUTION
Knowledge Booster
Fundamentals of Computer System
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-engineering and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY