Warning: foreach() argument must be of type array|object, bool given in /var/www/html/web/app/themes/studypress-core-theme/template-parts/header/mobile-offcanvas.php on line 20

Question: This Exercise examines the single error correcting, double error detecting (SEC/DED) Hamming code.

(5.9.1) What is the minimum number of parity bits required to protect a 128-bit word using the SEC/DED code?

(5.9.2) Section 5.5 states that modern server memory modules (DIMMs) employ SEC/DED ECC to protect each 64 bits with 8 parity bits. Compute the cost/performance ratio of this code to the code from 5.9.1. In this case, cost is the relative number of parity bits needed while performance is the relative number of errors that can be corrected. Which is better?

(5.9.3) Consider a SEC code that protects 8-bit words with 4 parity bits. If we read the value 0x375, is there an error? If so, correct the error.

Short Answer

Expert verified

(5.9.1)

The minimum number of parity bits is 9 for 128-bit words.

(5.9.2)

The cost/performance ratio of 64 bit with 8 parity bits is 9.057 and for 128 bit with 9 parity bits is 9.72. The code with 64 bits and 8 parity bits is better.

(5.9.3)

There is an error in bit 8 of the value. The correct value is 0x365.

Step by step solution

01

Define single error-correcting, double error detecting (SEC/DED) Hamming code

Hamming code provides a technique to detect errors in the data and correct single-bit errors. In this method, redundant bits are added at specific locations within the data. These redundant bits are data bits. The value for these bits is calculated and inserted into the data for error detection and correction. On the receiver side, recalculation is performed to detect errors in the data.

02

Formula to calculate the number of parity bits in hamming code

(5.9.1)

Let be the number of data bits and be the number of parity bits. To calculate the number of parity bits to apply Hamming code, the following equation should be satisfied:


In another form, it can be written as:

03

Calculate the number of parity bits for a 128-bit word

In the given problem, the number of data bits is 128. Using the formula given in the above step, the following condition should be satisfied:

Putting the value of 8 for , the equation is satisfied. That is,

Adding an extra 1 bit to the value of gives the number of parity bits equal to 9.

04

Define cost/performance ratio

(5.9.2)

The cost/performance ratio is the ability to perform for the given cost. The cost in the given problem is a relative number of parity bits used and performance is a relative number of errors that can be corrected. The method with a lower cost/performance ratio is better.

05

Calculate the cost/performance ratio

The modern server memory module has 64 data bits and 8 parity bits. The code from 5.9.1 has 128 data bits and 9 parity bits.

The cost rate for 64-bit data with 8 parity bits is calculated as:

The cost rate for 128-bit data with 9 parity bits is calculated as:

With 64-bit data and 8 parity bits, the total number of bits is 72. Hamming code can correct one-bit errors in these data bits. So, the performance rate for 64-bit data with 8 parity bits is calculated as:

With 128-bit data and 9 parity bits, the total number of bits are 137. Hamming code can correct one-bit errors in these data bits. So, the performance rate is calculated as:

The cost/performance ratio for 64-bit data is 9.057 and for 128-bit data is 9.72. Thus, 64-bit data with 8 parity bits is better because it has a low cost/performance ratio.

06

Detecting the error in 0x375

(5.9.3)

The received message is 0x375. The binary representation of the message is 0011 0111 0101. It has 8 data bits and 4 parity bits as below:

Bit 1

Bit 2

Bit 3

Bit 4

Bit 5

Bit 6

Bit 7

Bit 8

Bit 9

Bit 10

Bit 11

Bit 12

Parity bit 1

Parity bit 2

Data bit 1

Parity bit 3

Data bit 2

Data bit 3

Data bit 4

Parity bit 4

Data bit 5

Data bit 6

Data bit 7

Data bit 8

0

0

1

1

0

1

1

1

0

1

0

1

Parity bit 1 check bits 1,3,5,7,9, and 11. These bit positions have values 010100. It has two 1s. So even parity.

Parity bit 2 checks bits 2,3,6,7,10, and 11. These bit positions have values 011110. It has four 1s. So even parity.

Parity bit 3 checks bits 4,5,6,7, and 12. These bit positions have values 10111. It has four 1s. So even parity.

Parity bit 4 checks bits 8,9,10,11, and 12. These bit positions have values 10101. It has three 3s. So odd parity. There is an error.

07

Correcting error

Parity 4 contains an error. So, bit 8 has an error. This bit is wrong. It is changed to 0. The correct data is

0011 0110 0101

In hexadecimal, the correct value is 0x365.

Unlock Step-by-Step Solutions & Ace Your Exams!

  • Full Textbook Solutions

    Get detailed explanations and key concepts

  • Unlimited Al creation

    Al flashcards, explanations, exams and more...

  • Ads-free access

    To over 500 millions flashcards

  • Money-back guarantee

    We refund you if you fail your exam.

Over 30 million students worldwide already upgrade their learning with Vaia!

One App. One Place for Learning.

All the tools & learning materials you need for study success - in one app.

Get started for free

Most popular questions from this chapter

One of the biggest impediments to widespread use of virtual machines is the performance overhead incurred by running a virtual machine. Listed below are various performance parameters and application behavior.

Base CPI

Priviliged O/S Accesses per 10,000 Instructions

Performance Impact to Trap to the Guest O/S

Performance Impact to Trap to VMM

I/O Access per 10,000 Instructions

I/O Access Time (Includes Time to Trap to Guest O/S)

1.5

120

15 cycles

175 cycles

30

1100 cycles

(5.15.1) Calculate the CPI for the system listed above assuming that there are no accesses to I/O. What is the CPI if the VMM performance impact doubles? If it is cut in half? If a virtual machine software company wishes to obtain a 10% performance degradation, what is the longest possible penalty to trap to the VMM?

(5.15.2) I/O accesses often have a large impact on overall system performance. Calculate the CPI of a machine using the performance characteristics above, assuming a non-virtualized system. Calculate the CPI again, this time using a virtualized system. How do these CPIs change if the system has the I/O access? Explain why I/O bound applications have a smaller impact from virtualization.

(5.15.3) Compare and contrast the ideas of virtual memory and virtual machines. How do the goals of each compare? What are the pros and cons of each? List a few cases where virtual memory is desired, and a few cases where virtual machines are desired.

(5.15.4) Section 5.6 discusses virtualization under the assumption that the virtualized system is running the same ISA as the underlying hardware. However, one possible used of virtualization is to emulate non-native ISAs. An example of this is QEMU, which emulates a variety of ISAs such as MIPS, SPARC, and PowerPC. What are some of the difficulties involved in this kind of virtualization? Is it possible for an emulated system to run faster than on its native ISA?

Media applications that play audio or video files are part of a class of workloads called โ€œstreamingโ€ workloads; i.e., they bring in large amounts of data but do not reuse much of it. Consider a video streaming workload that accesses a 512 KiB working set sequentially with the following address stream:

0, 2, 4, 6, 8, 10, 12, 14, 16, โ€ฆ

5.5.1 Assume a 64 KiB direct-mapped cache with a 32-byte block. What is the miss rate for the address stream above? How is this miss rate sensitive to the size of the cache or the working set? How would you categorize the misses this workload is experiencing, based on the 3C model?

5.5.2 Re-compute the miss rate when the cache block size is 16 bytes, 64 bytes, and 128 bytes. What kind of locality is this workload exploiting?

5.5.3 โ€œPrefetchingโ€ is a technique that leverages predictable address patterns to speculatively bring in additional cache blocks when a particular cache block is accessed. One example of prefetching is a stream buffer that prefetches sequentially adjacent cache blocks into a separate buffer when a particular cache block is brought in. If the data is found in the prefetch buffer, it is considered as a hit and moved into the cache and the next cache block is prefetched. Assume a two-entry stream buffer and assume that the cache latency is such that a cache block can be loaded before the computation on the previous cache block is completed. What is the miss rate for the address stream above?

Cache block size (B) can affect both miss rate and miss latency. Assuming a 1-CPI machine with an average of 1.35 references (both instruction and data) per instruction, help find the optimal block size given the following miss rates for various block sizes.

8:4%

16:3%

32:2%

64:1.5%

128:1%

5.5.4 What is the optimal block size for a miss latency of 20ร—B cycles?

5.5.5 What is the optimal block size for a miss latency of 24+B cycles?

5.5.6 For constant miss latency, what is the optimal block size

For a direct-mapped cache design with a 32-bit address, the following bits of the address are used to access the cache.

Tag

Index

offset

31-10

9-5

4-0

5.3.1 What is the cache block size (in words)?

5.3.2 How many entries does the cache have?

5.3.3 What is the ratio between total bits required for such a cache implementation over the data storage bits?

Starting from power on, the following byte-addressed cache references are recorded.

ADDRESS

0

4

16

132

232

160

1024

30

140

3100

180

2180

5.3.4 How many blocks are replaced?

5.3.5 What is the hit ratio?

5.3.6 List the final state of the cache, with each valid entry represented as a record of <index, tag, data>

In this exercise we look at memory locality properties of matrix computation. The following code is written in C, where elements within the same rwo are stored contiguously. Assume each word is a 32-bit integer.

for(I=0;I<8;I++)

for(J=0;J<8000;J++)

A[I][J]=B[I][0]+A[J][I];

5.1.1 [5] How many 32-bit integers can be stored in a 16-byte cache block?

5.1.2 [5] References to which variables exhibit temporal locality?

5.1.3 [5] References to which variables exhibit spatial locality?

Locality is affected by both the reference order and data layout. The same computation can also be written below in Matlab, which differs from C by storing matrix elements within the same column contiguously in memory.

for I=1:8

for J=1:8000

A(I,J)=B(I,0)+A(J,I);

end

end

5.1.4. [10] How many 16-byte cache blocks are needed to store all 32-bit matrix elements being referenced?

5.1.5 [5] References to which variables exhibit temporal locality?

5.1.6 [5] References to which variables exhibit spatial locality?

In this exercise we show the definition of a web server log and examine code optimizations to improve log processing speed. The data structure for the log is defined as follows:

struct entry {

int srcIP; // remote IP address

char URL[128]; // request URL (e.g., โ€œGET index.htmlโ€)

long long refTime; // reference time

int status; // connection status

char browser[64]; // client browser name

} log [NUM_ENTRIES];

Assume the following processing function for the log:

topK_sourceIP (int hour);

5.19.1 Which fields in a log entry will be accessed for the given log processing function? Assuming 64-byte cache blocks and no prefetching, how many caches misses per entry does the given function incur on average?

5.19.2 How can you reorganize the data structure to improve cache utilization and access locality? Show your structure definition code.

5.19.3 Give an example of another log processing function that would prefer a different data structure layout. If both functions are important, how would you rewrite the program to improve the overall performance? Supplement the discussion with code snippets and data.

For the problems below, use data from โ€œCache performance for SPEC CPU2000 Benchmarksโ€(http://www.cs.wisc.edu/multifacet/misc/spec2000cache-data/) for the pairs of benchmarks shown in the following table.

a.

Mesa/gcc

b.

mcf/swim

5.19.4 For 64KiB data caches with varying set associativities, what are the miss rates broken down by miss types (cold, capacity, and conflict misses) for each benchmark?

5.19.5 Select the set associativity to be used by a 64KiB L1 data cache shared by both benchmarks. If the L1 cache has to be directly mapped, select the set associativity for the 1 MiB cache.

5.19.6 Give an example in the miss rate table where higher set associativity increases the miss rate. Construct a cache configuration and reference stream to demonstrate this.

See all solutions

Recommended explanations on Computer Science Textbooks

View all explanations

What do you think about this solution?

We value your feedback to improve our textbook solutions.

Study anywhere. Anytime. Across all devices.

Sign-up for free