Docsity

ECE 2534 Test 2 - Bit Reversal and Video Driver Issues, Exams of Microprocessors

Toggle sidebar
bg1
ECE 2534 Test 2 November 20, 2008
1. Write a subroutine BitReverse that takes an integer as input and returns an integer
with binary representation the bit-reversed version of the input integer. This
routine will be used to convert words stored in an LSB-first format to the MSB-
first format of the MicroBlaze. It will be called from the main C program many
times per second and so must be as fast as possible.
2. The following lines appear in code for a video driver:
#define DRAM_BASE 0x8c000000 // base address of external ram
volatile int *FBP; // Frame Buffer pointer
!
M
main {
*FRP = DRAM_BASE; //set pointer to start of Frame Buffer
!
M
*FBP += 80; // increment pointer to next line
!
M
Explain why this code will not work as expected.
3. For the microcontroller interface to RAM, which we discussed in class and is
depicted schematically in Figure 1,
a. Draw the connections required to put the RAM chip in the memory map
with lowest address 0x6000. What is the highest address. Be sure to use
full decoding.
b. Write timing inequalities for the following Read Cycle specifications:
i. tAVAV Specified as a minimum required time.
ii. tELQV Specified as a maximum required time.
iii. tEHQZ This quantity has both a minimum and maximum
specification and you should write a timing inequality for each
separately.
4. Write a subroutine PixelSet that takes as input two unsigned integers, x and y, that
represent the horizontal and vertical coordinates of a pixel in a VGA screen
(640x480). The subroutine should color the corresponding pixel black without
changing the values of any other pixels. The frame buffer is set up as in
Homework 7 and Lab 4, with a starting address of DRAM_BASE, which you can
assume has been previously defined in a #define statement.
pf3
pf4
pf5

Partial preview of the text

Download ECE 2534 Test 2 - Bit Reversal and Video Driver Issues and more Exams Microprocessors in PDF only on Docsity!

ECE 2534 Test 2 November 20, 2008

  1. Write a subroutine BitReverse that takes an integer as input and returns an integer with binary representation the bit-reversed version of the input integer. This routine will be used to convert words stored in an LSB-first format to the MSB- first format of the MicroBlaze. It will be called from the main C program many times per second and so must be as fast as possible.
  2. The following lines appear in code for a video driver: #define DRAM_BASE 0x8c000000 // base address of external ram volatile int *FBP; // Frame Buffer pointer !

M

main { *FRP = DRAM_BASE; //set pointer to start of Frame Buffer !

M

*FBP += 80; // increment pointer to next line !

M

Explain why this code will not work as expected.

  1. For the microcontroller interface to RAM, which we discussed in class and is depicted schematically in Figure 1, a. Draw the connections required to put the RAM chip in the memory map with lowest address 0x6000. What is the highest address. Be sure to use full decoding. b. Write timing inequalities for the following Read Cycle specifications: i. tAVAV Specified as a minimum required time. ii. tELQV Specified as a maximum required time. iii. tEHQZ This quantity has both a minimum and maximum specification and you should write a timing inequality for each separately.
  2. Write a subroutine PixelSet that takes as input two unsigned integers, x and y , that represent the horizontal and vertical coordinates of a pixel in a VGA screen (640x480). The subroutine should color the corresponding pixel black without changing the values of any other pixels. The frame buffer is set up as in Homework 7 and Lab 4, with a starting address of DRAM_BASE, which you can assume has been previously defined in a #define statement.