Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The Commodore 64, a popular home computer in the 1980s, was able to display 320 x 200 pixels in its hi-res graphics mode. In this

The Commodore 64, a popular home computer in the 1980s, was able to display 320 x 200 pixels in its hi-res graphics mode. In this problem, and one in next weeks written homework assignment, we will explore the mathematics of how the Commodore 64 stores pixels in video memory.

image text in transcribed

I don't understand how to solve this problem. I need help on a) and b) and c). Please show work so I can understand!

3. The Commodore 64, a popular home computer in the 1980s, was able to display 320 x 200 pixels in its "hi-res" graphics mode. In this problem, and one in next week's written homework assignment, we will explore the mathematics of how the Commodore 64 stores pixels in video memory. Pixel coordinates on the screen are counted from the upper left to the lower right. This means that the upper left pixel is (0,0), the upper right pixel is (319,0), the lower left pixel is (0,199), and the lower right pixel is (319,199) The hi-res display s subdivided into ells of size 8x8 pixels, and cells are numbered consecutively, starting at zero, horizontally from left to right, then vertically from top to bottom. Observe that this means that there are 40 columns of cells, and 25 rows. The diagramillustrates the cell numbering. 38 39 Suppose a pixel P with coordinates x and y is given. This means thatx and y are integers with 0 Sx S 319 and 0 s y 199. Suppose p is the number of the column of the cell P is in, counting columns from left to right, starting at 0. Suppose q is the number of the row of the cell P is in, counting rows from the top down, starting at 0. 40 | 41 | 42 | .. | 78 | 79 960 961 962 998 999 Observe that this means that p and q are integers with 0 S p S 39 and 0 S q S 24. a) Express p and q in terms of x and y. b) What is the position (a,b) of P within its cell, in terms of x and y? In these relative coordinates, the top left pixel is (0,0), the bottom right pixel is (7,7) What is the cell number c of the cell that contains P in terms of p and q? c) Use the notations div and mod as needed. You do not need to give explanations here

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Visual C# And Databases

Authors: Philip Conrod, Lou Tylee

16th Edition

1951077083, 978-1951077082

More Books

Students also viewed these Databases questions