Review Finals Flashcards

Review finals

1
Q

What is the purpose of the Page Table

A

Answer:

The page table is where the operating system stores its mappings of virtual addresses to physical addresses, with each mapping also known as a page table entry (PTE)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

A computer system uses byte-addressing, with a 14-bit virtual address, a 2Kbyte page
size, and a 13-bit physical address. If virtual pages 1, 2 and 3 are loaded into physical
page-frames 3, 0 and 2, respectively, draw the page table showing the valid bit and
frame number for each page table entry

A

Given 14-bit VA, 2Kbyte (11-bit) page size, and 13-bit PA.

In VA
bit index: 13 12 11 (3 bits) will contain VPN
bit index: 10 9 8 7 6 5 4 3 2 1 will contain VPO

In PA
bit index: 12 11 (2 bits) will contain PPN
bit index: bit index: 10 9 8 7 6 5 4 3 2 1 will contain PPO

In Page Table = 2^3 = 8 page table entries (PTEs)
i-PPN-Valid
0 
1  - 3 - 1
2 - 0 - 1
3 - 2 - 1
4
5
6
7
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Describe the process to get the decimal value of the single-byte 2’s-complement number 0xF3?

A

Answer:
2’s complement => represents signed numbers
-write the hex value in binary
-the most significant bit is the sign bit (negative value)
-the rest of the bits are positive
-add all numbers together

0xF3 = > 1111 0011
=> (-128) + (64 + 32 + 16 + 2 + 1)
=> -13 (decimal)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the purpose of the following instruction?

xor %fs:0x28,%rcx

A

fs: is also known as a canary or a stack-guard storage to make sure that data is not corrupted. Xoring 2 values that are equal will set a zero bit. If XORing the values in %fs:0x28 with %rcx set off a non-zero result, this might mean that the data may have been compromised or corrupted.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the purpose and objective of a line replacement policy for cache memory?

A

If the set is full of valid cache lines, after retrieving the word requested by the CPU, it needs a place in the cache, the cache needs to make room for this memory address so it must be allowed to evict the cache lines that are not currently being used

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Why do spinning disk drives use multiple zone recording?

A

To increase data capacity. It does this by placing more sectors per zone on outer tracks than on inner tracks.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Suppose we have a floating-point 8-bit number format for which the most significant bit is used for the sign, the next 3 bits are used for the exponent and the remaining 4 bits for the fraction.

Using the IEEE convention for normalized, de-normalized and special numbers, what is the floating-point value of bytes containing the hexadecimal
numbers 0xA8, 0x04 and 0xF1?

A

1-bit sign, 3-bit exp, 4-bit frac

Examine: addresses
0xA8 = 1 010 1000 (normalized)
0x04 = 0 000 0100 (de-norm)
0xF1? = 1 111 0001 (special)

Denorm: 
V = (-1)^s x M x 2^E
Bias = 2^(k-1 )- 1 = 2^2 -1 = 4 -1 =[3]
E = 1 - Bias (1-3) = [-2]
M = f = [1/4]
Therefore, V = (1 x 1/4 x 2^-2) 
V = 1/16
Norm:
Bias = [3]
E = e -Bias (2-3) = [-1]
M= 1 + f =  1/2 = [3/2]
V = (-1) x 3/2 x 2^-1 = -3/4

Special:
since fraction are not all zero
this is NaN or not a number.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the value, in hexadecimal, of the following expression?
0x13 ^ (0xF2 & 0x55)

A

0x13 ^ (0xF2 & 0x55)

     1111 0010
& 0101 0101
-----------------
    0101 0000
^  0001 0011
-------------------
    0100 0011

In hex: 0x43

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How slow is the DRAM compared to SRAM?

A

About 10 times slower, but bigger in size.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are the advantages and disadvantages of solid-state drives (SSD) compared to spinning disk drives

A

Advantages of SSD over spinning disk drives

  1. 1000 times faster than spinning disk
  2. faster random access times
  3. use less power
  4. Smaller physical size

Disadvantage of SSD over spinning disk drives

  1. wears out over time after repeated writes
  2. 30 times more expensive per byte than rotating disk
  3. storage capacity is less than rotating disk
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is a cache (“pronounced as cash”)?

A

A small, fast storage device that acts as a staging area for the data objects stored in a larger, slower, device

How well did you know this?
1
Not at all
2
3
4
5
Perfectly