Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assignment 1 Due Date: Friday, February 26th, 2021 @ 11:59pm CST 1. [2 marks] Give the 8-bit 2's complement binary representation of the following numbers:

image text in transcribed

Assignment 1 Due Date: Friday, February 26th, 2021 @ 11:59pm CST 1. [2 marks] Give the 8-bit 2's complement binary representation of the following numbers: a. 4210 b. -1710 2. [2 marks] What is the result of the following calculation in binary assume all numbers are signed 2's complement): 0100 00012 + 1011 11002 = ? Give the answer in binary. Then, show the calculation using decimal numbers. 3. [2 marks] For each of the following 6-bit operations, calculate the values of the C, Z, V, and N flags: a. 001011 + 001101 b. 111111 + 000001 C. 000000-000001 d. 111110 + 111111 4. [3 marks] Explain the function of the Program Counter (PC) in the CPU. Why does it increment in steps of 4 in Figure 3.2 of the Lecture 3 notes? If you designed a hypothetical processor with 64-bit instructions, would this change how the PC increments and, if so, how? 5. [2 marks] Give the values of the following registers after running each instruction. Express your answer in binary or hexadecimal. a. Ifr1 = 0xF0E2A0FD and r2 = 0x00FF0F0F what is the value of r3 after executing BIC r3, ri, r2? (Hint: try writing the values of the registers in binary). b. If r4 = 0x000000FF, what is the value of r5 after executing ADD r5, r4, r4, LSL #2 ? 6. [2 marks] What is the effect of the instruction MOV ro, ro, ASR #31 ? 7. [3 marks] Give an example of one or more ARM instructions that will set both the carry (C) bit and the zero (2) bit in the CPSR after the instruction(s) are finished. If you require registers to hold particular values before your code runs, be sure to include those values in your answer (ex. r0 = 0x000000FF) 8. [4 marks] Some processors have an instruction to find the location of the first bit set to 1 within a word ("find the first one"). Assume that a word is stored in r1. Write an ARM sequence of instructions that puts the location of the first bit in r1 that is set to 1 into r2. Count from the left, so that if bit 31 is set in r1 then the value in r2 will be 0. If only bit Ois set in r1, then the value in r2 should be 31. If no bit in ri is set, then the value in r2 should be 32

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Excel As Your Database

Authors: Paul Cornell

1st Edition

1590597516, 978-1590597514

More Books

Students also viewed these Databases questions