Day 9 Flashcards
- Recall the process of multiplication.*
- Note that with signed integers, we use sign extension and the last number becomes its 2’s complement and than being added to the accumulator*
Recall signed multiplication.
Compute it yourself
Compute -5/8 * 6/8
- Recall the method for integer division*
- Now slove 45/6*
Describe the exponent of 32 bit machine
8 bits are reserved for the exponent.
23 bits are reserved for the mantisa.
1 bit is reserved for sign.
because we’re using 2’s complement we have a range of -127<=x<=128.
We add 127 to x to have positive numbers.
Zero is taken by x = -127, and mantisa all zeros.
x = 128 implies infinity, so..
-126<=x<=127 -> (+127) -> 1<=x<=254
That is, exponent can shift from -126 to 127.
If the number is normalized, it starts with 1, thus the smallest mantisa is 1.0, and largest is 2-2^-23.
If the number is not normalized, it starts with 0, thus the smallest mantisa is 2^-23 and largest is 1-2^-23
- With addition, you want the two numbers to have the same exponent - 1/2*
- With substraction, you want the two number to have the same exponent -1/2*
- 1) the greater one of the two*
- 2) the smaller one of the two*
1
2
Explain associative cache
Address: 13|3 =>BlockNumber|LineInBlock
Size of block = size of line in cache.
Tag memory = an array in the cache in which block numbers are saved
Valid bits = 1 if block is present in the cache.
Time of search O(n), where n is the number of blocks in the cache.
Write about cache:
- Average read time
- Average write time
- Average memory-access time
- With miss-hit there are two approches.*
- Name them and explain.*
- With miss-hit there are two write approaches*
- Name them and explain*
- With hit there are two write approaches*
- Name them and explain*
What are the advantages of mapping system for both I/O and memory?
- Data transfer to/from CPU is the same for both I/O and memory.
- Number of board connections is smaller
- What is the size of the I/O space?
- How a device is identified?
- How many device can be connected?
- How can we know whether address refers to I/O or Memory?
- Where are the control bits are stored?
- 2^10 addresses
- by two addresses(registers)
- data register
- status register
- 20 MSB’s in the address tell us if it belongs to memory or I/O
- Control bits going from CPU to I/O are stored in the command register
- Control bits going from I/O to CPU are stored in the status register.