0% found this document useful (0 votes)
5 views5 pages

Docx

Uploaded by

gswaeta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views5 pages

Docx

Uploaded by

gswaeta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Final Exam

CIS 2107
1. Please answer the True/False questions below:

1.1. [2 pts] A virtual memory is a large secondary memory.


(A) True
(B) False

1.2. [2 pts] If a machine has a 32-bit virtual address format, then it allows upto 4 GB of
virtual address space.
(A) True
(B) False

1.3. [2 pts] Two’s complement of a binary number is 1 added to the one’s complement of the
binary number.
(A) True
(B) False

1.4. [2 pts] In the memory hierarchy, as the speed of operation increases the memory size
also increases.
(A)True
(B)False

1.5. [2 pts] If the data “ABCD” is to be stored in a little endian machine, it will be stored as
“ABCD”.
(A)True
(B)False

This study source was downloaded by 100000853483252 from CourseHero.com on 05-03-2023 16:01:46 GMT -05:00

https://www.coursehero.com/file/61053890/Final-exam-2docx/
2. [10 pts] What is the output of following program?

#include<stdio.h>
void f(int *p, int *q)
{
p = q;
*p = 20;
}

int i = 10, j = 100;

int main()
{
f(&i, &j);
printf("%d %d \n", i, j);
}

(A) 20 20
(B) 20 10
(C) 10 10
(D) 10 20

This study source was downloaded by 100000853483252 from CourseHero.com on 05-03-2023 16:01:46 GMT -05:00

https://www.coursehero.com/file/61053890/Final-exam-2docx/
3. [10 pts] Convert -1313.3125 to IEEE 32-bit floating point format.

This study source was downloaded by 100000853483252 from CourseHero.com on 05-03-2023 16:01:46 GMT -05:00

https://www.coursehero.com/file/61053890/Final-exam-2docx/
4. [10 pts] If the data held in memory (%rdi) and (%rsi) are 10 and 20 respectively, then what
will be the value of (%rdi) and (%rsi) after the following code is executed?

movq (%rdi), %rdx


movq (%rsi), %rax
movq %rax, (%rdi)
movq %rdx, (%rsi)
ret

(A) values of (%rdi) and (%rsi) will be 10 and 20 respectively


(B) values of (%rdi) and (%rsi) will be 20 and 10 respectively
(C) values of (%rdi) and (%rsi) will be 10 and 10 respectively
(D) values of (%rdi) and (%rsi) will be 20 and 20 respectively

This study source was downloaded by 100000853483252 from CourseHero.com on 05-03-2023 16:01:46 GMT -05:00

https://www.coursehero.com/file/61053890/Final-exam-2docx/
5. [10 pts] If the data held in registers %rdi and %rsi are 20 and 30 respectively, then what will
be the return value after the following code is executed?

cmpq %rsi, %rdi


jle .L4
movq %rdi, %rax
subq %rsi, %rax
ret
.L4:
movq %rsi, %rax
subq %rdi, %rax
ret

(A) -10
(B) 20
(C) 10
(D) 30

This study source was downloaded by 100000853483252 from CourseHero.com on 05-03-2023 16:01:46 GMT -05:00

https://www.coursehero.com/file/61053890/Final-exam-2docx/
Powered by TCPDF (www.tcpdf.org)

You might also like