Question: a) Write a formula that gives the offset for the byte that stores pixel (x,y) in terms of x and y. Build on the formulas

 a) Write a formula that gives the offset for the byte

a) Write a formula that gives the offset for the byte that stores pixel (x,y) in terms of x and y. Build on the formulas derived in last weeks homework and show work.

b) Which bit (0 to 7) of the byte that contains the information about pixel (x,y) controls whether pixel (x,y) is set? Give a formula for the bit number. Make sure to take into account that the high bit is on the left side.

4. This problem continues our investigation of the memory pattern of hi-res graphics storage in the Commodore 64 computer from the previous week. We have already learned that the 320 x 200 pixel display is subdivided into cells of 8x8 pixels each and how to convert (x,y) pixel coordinates into (p.q) cell coordinates, consecutive cell numbers c and the relative pixel coordinates (a,b) within each cell. We now turn to the problem of how pixel information is stored in (mapped to") video memory. We shall ignore color information in this problem; every pixel is represented by one bit, where 1 means the pixel is set, and 0 means the pixel is not set. In each cell, each row of 8 pixels is represented by one byte, counted from the top and starting at 0. Given a row and its byte, the high bit of that byte, also known as bit 7 (the one with positional value 27 128), represents the leftmost pixel in the row. Bit 6 represents the next pixel to the right after that, and so on. Bit 0 represents the rightmost pixel in the row. Here is an example of a cell and the bytes that describe it bit pos. value: 128 64 16 84 byte #" value in this example 0, 34 1,127 2,73 3, 127 4, 65 5, 65 6, 127 7, 28 The bytes are stored consecutively in video memory in order of byte number and cell number: 1st byte of video memory: cell 0/byte 0 2nd byte of video memory: cell 0/byte 1 8th byte of video memory: cell 0/byte 7 9th byte of video memory: cell 1/byte 0, etc. By the offset of a byte in video memory we mean its position relative to the first byte. The offset of the first byte is 0, the offset of the second byte is 1, and so on 4. This problem continues our investigation of the memory pattern of hi-res graphics storage in the Commodore 64 computer from the previous week. We have already learned that the 320 x 200 pixel display is subdivided into cells of 8x8 pixels each and how to convert (x,y) pixel coordinates into (p.q) cell coordinates, consecutive cell numbers c and the relative pixel coordinates (a,b) within each cell. We now turn to the problem of how pixel information is stored in (mapped to") video memory. We shall ignore color information in this problem; every pixel is represented by one bit, where 1 means the pixel is set, and 0 means the pixel is not set. In each cell, each row of 8 pixels is represented by one byte, counted from the top and starting at 0. Given a row and its byte, the high bit of that byte, also known as bit 7 (the one with positional value 27 128), represents the leftmost pixel in the row. Bit 6 represents the next pixel to the right after that, and so on. Bit 0 represents the rightmost pixel in the row. Here is an example of a cell and the bytes that describe it bit pos. value: 128 64 16 84 byte #" value in this example 0, 34 1,127 2,73 3, 127 4, 65 5, 65 6, 127 7, 28 The bytes are stored consecutively in video memory in order of byte number and cell number: 1st byte of video memory: cell 0/byte 0 2nd byte of video memory: cell 0/byte 1 8th byte of video memory: cell 0/byte 7 9th byte of video memory: cell 1/byte 0, etc. By the offset of a byte in video memory we mean its position relative to the first byte. The offset of the first byte is 0, the offset of the second byte is 1, and so on

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!