CDL Modules
Files
teletext

Files

file  teletext.cdl
 CDL implementation of a teletext decoder.
 

Detailed Description

Modules

module teletext::teletext ( clock  clk,
input bit  reset_n,
input t_teletext_character  character,
input t_teletext_timings  timings,
output t_teletext_rom_access  rom_access,
input bit  rom_data[45],
output t_teletext_pixels  pixels 
)

This is an implementaion of the core of a presentation level 1.0 teletext decoder, for arbitrary sized teletext output displays.

The output is supplied at 12 pixels per clock (one character width) The input is a byte of per clock of character data.

The implementation does not currently support double width or double size characters - they are not presentation level 1.0 features.

Teletext characters are displayed from a 12x20 grid. The ROM characters have two background rows, and then are displayed with 2 background pixels on the left, and then 10 pixels from the ROM The ROM is actually 5x9, and it is doubled to 10x18.

The type of pixel doubling is controlled with the timings input. It can be pure doubling, or smoothed. Some outputs may not want to use the doubling, for which the best approach is to request only even scanlines (in the timings) and to not smoothe, and then to select alternate pixel color values from the output bus.

Doubling

Doubling without smoothing can be achieved be true doubling of pixels

A simple smoothing can be performed for a pixel depending on its NSEW neighbors:

  |NN|
  |NN|
WW|ab|EE
WW|cd|EE
  |SS|
  |SS|

a is filled if the pixel is filled itself, or if N&W

b is filled if the pixel is filled itself, or if N&E

c is filled if the pixel is filled itself, or if S&W

d is filled if the pixel is filled itself, or if S&E

Hence one would get:

|..|**|**|**|..|
|..|**|**|**|..|
|---------------
|**|..|..|**|**|
|**|..|..|**|**|
|---------------
|..|**|..|..|**|
|..|**|..|..|**|

smoothed to:

|..|**|**|**|..|
|.*|**|**|**|*.|
|---------------
|**|*.|.*|**|**|
|**|*.|..|**|**|
|---------------
|.*|**|..|.*|**|
|..|**|..|..|**|

Or, without intervening lines:

|..******..|
|..******..|
|**....****|
|**....****|
|..**....**|
|..**....**|

smoothed to:

|..******..|
|.********.|
|***..*****|
|***...****|
|.***...***|
|..**....**|

So for even scanlines ('a' and 'b') the smoother needs row n and row n-1.

a is set if n[x] or n[x-left]&(n-1)[x]

b is set if n[x] or n[x-right]&(n-1)[x]

For odd scanlines ('c' and 'd') the smoother needs row n and row n+1.

c is set if n[x] or n[x-left]&(n+1)[x]

d is set if n[x] or n[x-right]&(n+1)[x]

This method has the unfortunate impact of smoothing two crossing lines, such as a plus:

|....**....|     |....**....|
|....**....|     |....**....|
|....**....|     |....**....|
|....**....|     |...****...|
|**********|     |**********|
|**********|     |**********|
|....**....|     |...****...|
|....**....|     |....**....|
|....**....|     |....**....|
|....**....|     |....**....|

Hence a better smoothing can be performed for a pixel depending on all its neighbors:

|NW|NN|NE|
|  |NN|  |
|WW|ab|EE|
|WW|cd|EE|
|  |SS|  |
|SW|SS|SE|

a is filled if the pixel is filled itself, or if (N&W) but not NW

b is filled if the pixel is filled itself, or if (N&E) but not NE

c is filled if the pixel is filled itself, or if (S&W) but not SW

d is filled if the pixel is filled itself, or if (S&E) but not SE

Hence one would get:

|..|**|**|**|..|
|..|**|**|**|..|
|---------------
|**|..|..|**|**|
|**|..|..|**|**|
|---------------
|..|**|..|..|**|
|..|**|..|..|**|

smoothed to:

|..|**|**|**|..|
|.*|**|**|**|..|
|---------------
|**|*.|..|**|**|
|**|*.|..|**|**|
|---------------
|.*|**|..|..|**|
|..|**|..|..|**|

Or, without intervening lines:

|..******..|
|..******..|
|**....****|
|**....****|
|..**....**|
|..**....**|

smoothed to:

|..******..|
|.*******..|
|***...****|
|***...****|
|.***....**|
|..**....**|

So for even scanlines ('a' and 'b') the smoother needs row n and row n-1.

a is set if n[x] or (n[x-left]&(n-1)[x]) &~ (n-1)[x-left]

b is set if n[x] or (n[x-right]&(n-1)[x]) &~ (n-1)[x-right]

For odd scanlines ('c' and 'd') the smoother needs row n and row n+1.

c is set if n[x] or (n[x-left]&(n+1)[x]) &~ (n+1)[x-left]

d is set if n[x] or (n[x-right]&(n+1)[x]) &~ (n+1)[x-left]

Graphics

Graphics characters are 6 blobs on a 6x10 grid (contiguous, separated):

|000111| |.00.11|
|000111| |.00.11|
|000111| |......|
|222333| |.22.33|
|222333| |.22.33|
|222333| |.22.33|
|222333| |......|
|444555| |.44.55|
|444555| |.44.55|
|444555| |......|
Parameters
[in]clkCharacter clock
[in]reset_nActive low reset
[in]characterParallel character data in, with valid signal
[in]timingsTimings for the scanline, row, etc
[out]rom_accessTeletext ROM access, registered output
[in]rom_dataTeletext ROM data, valid in cycle after rom_access
[out]pixelsOutput pixels, three clock ticks delayed from valid data in