Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

VHDL function of divided pixel-frame to sub blocks

Status
Not open for further replies.

yuvalkesi

Member level 5
Joined
May 13, 2009
Messages
92
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
2,036
Hi,
I have a frame of 1920 X 1080 pixels (21 bit address). This frame is divided to 10 sub-blocks (5 rows x 2 colomns of blocks) , each sub block is 960 x 216 (<= 10bits x 8 bits).
I need to write a function which convert a 21bit address (of the 1920 X 1080 pixels) to a specific sub block, meaning, this function will tell me in which block (out of the 10) the specific pixel is referred to, and in which place it is exactly.
I don't need you guys to write down the function, avcourse... just some clues to get started. I'm kinda stuck.
I tried to simple the question by making it a 6 x 6 pixels (6bit address) question. I divided it to 6 sub-blocks, each one is 2 x 3 pixels (4bit address), but still, how do I know when I'm given the 6bit address (or the 21 bit address in the original question) which block I'm referred to?

Attached a scheme of the sub blocks in the original question. Each block is 960 x 216:

Thanks!
Tom.
 

its a real shame the sub blocks dont lie on nice 2^n boundaries, because that would be nice and easy.
Otherwise, I think you're going to have to manually check the boundaries.

eg:
if x > 960 then return 1
else return 0;
end if;

if x > 0 and x < 215 then return 0;
elsif x > 215 and x < 431 then return 1;

etc.

it would be fairly simple to set this up as a generic function with N boxes x M rows, and use a for loop to setup the ranges to check. But the bigger N or M are, the more comparitors you have in series (and lower the FMAX)
Checking the ranges is going to be much much easier than a divide.
 
Hi!
First of all,thanks for the thorough answer.
Now, sorry for being a bit slow... but what is X?
I mean, if it the address, then how can you use it twice (according to your example), in row check and in colomn check? if the address X is 2000, then it's bigger than 960 and it returns 1, but it not give me the correct sub block. Furthermore, it's bigger than 215... well, I'm confused.
Where does the count start for the 21 bit representation? Is it from the lower left? or upper right, upper left,etc? because the counting affect the location of address 2000, and this affect the sub block which hold this specific pixel.
I guess I'm totally out of focus here.
Is it something like that? (for the 21 bit representation)?
1.jpg

Can you explain a bit more?
Also, from what i understand, each subblock has its own set of addresses, starting from 0 (18bits). How do i know where is it exactly in the sub block address scheme once i know in which block is it?



Thanks again for your help.
Tom.
 
Last edited:

sorry, I meant x and y, as in pixel location on the screen.
 

Ok, but still, can you look at the picture I've attached in my last reply?

if the address is 2000, then it's bigger than 960 and it returns 1, but it does not give me the correct sub block.
Do I need to make If's for all the 216 boundaries in each sub block to determine in which sub block the pixel is? (that'll be 216*5 If's...).
For example:
if x > 960 then return 1
If x > 2879 then return 2 -- 2879=1920+960-1
If x > 3095 then return 2 -- 3095=2879+959

etc...

Furthermore, how do you interpret 21 bit address to different X and Y? 1920 x 1080=21bit address bus, so if the pixel address is 2000, for example, how do you define X and Y for that address?
Thx,

Tom
 
Last edited:

split the address into two halves. 11 bits for x, 10 bits for Y. then you can do separate compares.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top