<s>
The	O
Motorola	B-General_Concept
6845	I-General_Concept
,	O
or	O
MC6845	B-General_Concept
,	O
is	O
a	O
display	B-Device
controller	O
that	O
was	O
widely	O
used	O
in	O
8-bit	O
computers	O
during	O
the	O
1980s	O
.	O
</s>
<s>
Originally	O
intended	O
for	O
designs	O
based	O
on	O
the	O
Motorola	B-Device
6800	I-Device
CPU	O
and	O
given	O
a	O
related	O
part	O
number	O
,	O
it	O
was	O
more	O
widely	O
used	O
alongside	O
various	O
other	O
processors	O
,	O
and	O
was	O
most	O
commonly	O
found	O
in	O
machines	O
based	O
on	O
the	O
Zilog	B-General_Concept
Z80	I-General_Concept
and	O
MOS	B-General_Concept
6502	I-General_Concept
.	O
</s>
<s>
The	O
6845	B-General_Concept
is	O
not	O
an	O
entire	O
display	B-Device
solution	O
on	O
its	O
own	O
;	O
the	O
chip	O
's	O
main	O
function	O
is	O
to	O
properly	O
time	O
access	O
to	O
the	O
display	B-Device
memory	O
,	O
and	O
to	O
calculate	O
the	O
memory	O
address	O
of	O
the	O
next	O
portion	O
to	O
be	O
drawn	O
.	O
</s>
<s>
Other	O
circuitry	O
in	O
the	O
machine	O
then	O
uses	O
the	O
address	O
provided	O
by	O
the	O
6845	B-General_Concept
to	O
fetch	O
the	O
pattern	O
and	O
then	O
draw	O
it	O
.	O
</s>
<s>
The	O
6845	B-General_Concept
is	O
intended	O
for	O
character	O
displays	O
,	O
but	O
could	O
also	O
be	O
used	O
for	O
pixel-based	O
graphics	O
,	O
with	O
some	O
clever	O
programming	O
.	O
</s>
<s>
Among	O
its	O
better-known	O
uses	O
is	O
the	O
BBC	B-Device
Micro	I-Device
,	O
Amstrad	B-Device
CPC	I-Device
,	O
and	O
Videx	O
VideoTerm	O
display	B-Device
cards	O
for	O
the	O
Apple	B-Device
II	I-Device
.	O
</s>
<s>
It	O
is	O
also	O
part	O
of	O
many	O
early	O
graphics	O
adapter	O
cards	O
for	O
the	O
IBM	B-Device
PC	I-Device
,	O
including	O
the	O
MDA	B-Device
,	O
Hercules	B-Device
Graphics	I-Device
Card	I-Device
(	O
HGC	O
)	O
,	O
Color	B-Device
Graphics	I-Device
Adapter	I-Device
(	O
CGA	B-Device
)	O
and	O
the	O
Plantronics	O
Colorplus	O
.	O
</s>
<s>
Its	O
functionality	O
was	O
duplicated	O
and	O
extended	O
by	O
custom	O
circuits	O
in	O
the	O
EGA	B-Device
and	O
VGA	B-Protocol
PC	O
video	O
adapters	O
.	O
</s>
<s>
It	O
is	O
also	O
known	O
as	O
the	O
6845	B-General_Concept
CRTC	I-General_Concept
or	O
the	O
CRTC6845	B-General_Concept
,	O
meaning	O
"	O
cathode	B-Device
ray	I-Device
tube	I-Device
controller	O
"	O
.	O
</s>
<s>
This	O
version	O
was	O
used	O
on	O
the	O
Apricot	O
PC	O
and	O
Victor	B-Device
9000	I-Device
to	O
provide	O
a	O
800x400	O
resolution	O
monochrome	O
display	B-Device
.	O
</s>
<s>
A	O
common	O
clone	O
of	O
this	O
CRT	B-Device
controller	O
is	O
the	O
United	O
Microelectronics	O
Corporation	O
(	O
UMC	O
)	O
UM6845E	O
CRT	B-Device
controller	O
.	O
</s>
<s>
During	O
the	O
time	O
of	O
cold	O
war	O
technology	O
embargoes	O
,	O
the	O
6845	B-General_Concept
was	O
cloned	O
in	O
Bulgaria	O
under	O
the	O
designation	O
CM607	O
.	O
</s>
<s>
The	O
chip	O
generates	O
the	O
signals	O
necessary	O
to	O
interface	O
with	O
a	O
raster	O
display	B-Device
but	O
does	O
not	O
generate	O
the	O
actual	O
pixels	B-Algorithm
,	O
though	O
it	O
does	O
contribute	O
cursor	O
and	O
video-blanking	O
information	O
to	O
the	O
pixel	B-Algorithm
video	O
(	O
intensity	O
)	O
signals	O
.	O
</s>
<s>
It	O
is	O
used	O
to	O
produce	O
correctly	O
timed	O
horizontal	O
and	O
vertical	O
sync	O
and	O
provide	O
the	O
address	O
in	O
memory	O
from	O
which	O
the	O
next	O
pixel	B-Algorithm
or	O
set	O
of	O
pixels	B-Algorithm
should	O
be	O
read	O
.	O
</s>
<s>
The	O
process	O
of	O
reading	O
that	O
value	O
,	O
converting	O
it	O
into	O
pixels	B-Algorithm
,	O
and	O
sending	O
it	O
to	O
a	O
CRT	B-Device
is	O
left	O
to	O
other	O
circuits	O
.	O
</s>
<s>
Because	O
of	O
this	O
,	O
systems	O
using	O
the	O
6845	B-General_Concept
may	O
have	O
very	O
different	O
numbers	O
and	O
values	O
of	O
colors	O
,	O
or	O
may	O
not	O
support	O
color	O
at	O
all	O
.	O
</s>
<s>
The	O
sync	O
generation	O
includes	O
generation	O
of	O
horizontal	O
and	O
vertical	O
video	O
blanking	O
signals	O
,	O
which	O
are	O
used	O
to	O
condition	O
the	O
external	O
pixel	B-Algorithm
generation	O
circuits	O
.	O
</s>
<s>
This	O
is	O
useful	O
for	O
light	B-Device
pens	I-Device
and	O
light	B-Device
guns	I-Device
which	O
can	O
function	O
by	O
sending	O
a	O
pulse	O
to	O
the	O
6845	B-General_Concept
when	O
the	O
electron	O
beam	O
passes	O
,	O
allowing	O
a	O
running	O
program	O
to	O
read	O
back	O
the	O
location	O
that	O
was	O
pointed	O
at	O
.	O
</s>
<s>
Because	O
of	O
this	O
feature	O
,	O
most	O
computer	O
video	O
adapters	O
using	O
a	O
6845	B-General_Concept
included	O
a	O
light	B-Device
pen	I-Device
interface	O
,	O
though	O
it	O
was	O
usually	O
an	O
internal	O
connector	O
on	O
the	O
board	O
itself	O
,	O
not	O
on	O
the	O
outside	O
of	O
the	O
computer	O
,	O
and	O
it	O
was	O
usually	O
undocumented	O
in	O
the	O
user	O
manual	O
.	O
</s>
<s>
Because	O
all	O
aspects	O
of	O
video	O
timing	O
are	O
programmable	O
,	O
a	O
single	O
machine	O
can	O
switch	O
between	O
NTSC	O
and	O
PAL	B-Language
timings	O
in	O
software	O
.	O
</s>
<s>
The	O
6845	B-General_Concept
can	O
be	O
used	O
to	O
drive	O
monitors	O
or	O
any	O
other	O
raster	O
display	B-Device
.	O
</s>
<s>
The	O
chip	O
has	O
a	O
total	O
of	O
registers	B-General_Concept
controlling	O
all	O
aspects	O
of	O
video	O
timings	O
.	O
</s>
<s>
The	O
6845	B-General_Concept
is	O
intended	O
for	O
character	O
based	O
displays	O
.	O
</s>
<s>
Using	O
the	O
full	O
address	O
range	O
RA0-RA4:CA0-CA13	O
the	O
6845	B-General_Concept
can	O
address	O
words	O
of	O
memory	O
,	O
where	O
a	O
word	O
may	O
be	O
any	O
number	O
of	O
bits	O
chosen	O
by	O
the	O
system	O
designer	O
as	O
the	O
memory	O
width	O
.	O
</s>
<s>
If	O
the	O
word	O
size	O
is	O
one	O
byte	O
,	O
as	O
is	O
often	O
the	O
case	O
,	O
the	O
6845	B-General_Concept
can	O
address	O
512	O
KiB	O
.	O
</s>
<s>
for	O
32-bit	O
color	O
graphics	O
with	O
one	O
pixel	B-Algorithm
per	O
word	O
,	O
then	O
the	O
6845	B-General_Concept
can	O
address	O
2048	O
kiB	O
;	O
for	O
64-bit	O
words	O
,	O
it	O
can	O
address	O
twice	O
as	O
much	O
.	O
</s>
<s>
These	O
limits	O
arise	O
from	O
the	O
combination	O
of	O
the	O
6845	B-General_Concept
and	O
the	O
design	O
of	O
the	O
external	O
memory	O
connected	O
to	O
it	O
,	O
not	O
from	O
the	O
6845	B-General_Concept
alone	O
.	O
</s>
<s>
Though	O
the	O
number	O
of	O
unique	O
addresses	O
that	O
the	O
6845	B-General_Concept
can	O
address	O
is	O
limited	O
to	O
,	O
the	O
amount	O
of	O
memory	O
that	O
the	O
6845	B-General_Concept
can	O
address	O
may	O
be	O
significantly	O
larger	O
than	O
might	O
be	O
assumed	O
because	O
the	O
6845	B-General_Concept
imposes	O
no	O
limit	O
on	O
the	O
size	O
of	O
each	O
memory	O
location	O
that	O
it	O
addresses	O
.	O
</s>
<s>
It	O
is	O
also	O
significant	O
that	O
each	O
word	O
addressed	O
by	O
the	O
6845	B-General_Concept
does	O
not	O
have	O
to	O
equal	O
one	O
pixel	B-Algorithm
or	O
one	O
character	O
.	O
</s>
<s>
As	O
an	O
example	O
,	O
consider	O
the	O
use	O
of	O
the	O
6845	B-General_Concept
in	O
the	O
IBM	B-Device
CGA	I-Device
,	O
where	O
the	O
word	O
size	O
is	O
one	O
byte	O
and	O
each	O
word	O
represents	O
four	O
or	O
eight	O
pixels	B-Algorithm
in	O
the	O
medium	O
-	O
or	O
high-resolution	O
graphics	O
modes	O
respectively	O
,	O
or	O
one-half	O
character	O
.	O
</s>
<s>
In	O
CGA	B-Device
alphanumeric	O
(	O
text	O
)	O
mode	O
,	O
there	O
are	O
two	O
bytes	O
per	O
character	O
,	O
accessed	O
sequentially	O
by	O
the	O
6845the	O
first	O
byte	O
is	O
a	O
character	O
code	O
byte	O
and	O
the	O
second	O
byte	O
is	O
a	O
character	O
attribute	O
byte	O
.	O
</s>
<s>
This	O
causes	O
the	O
same	O
sequence	O
of	O
character	O
values	O
to	O
be	O
re-read	O
from	O
the	O
memory	O
for	O
each	O
raster	O
line	O
of	O
each	O
character	O
row	O
,	O
before	O
the	O
6845	B-General_Concept
advances	O
the	O
memory	O
address	O
to	O
the	O
next	O
character	O
row	O
and	O
repeats	O
the	O
same	O
pattern	O
.	O
</s>
<s>
Therefore	O
,	O
if	O
a	O
character	O
occupies	O
one	O
"	O
word	O
"	O
in	O
the	O
video	O
buffer	O
,	O
a	O
display	B-Device
of	O
l	O
lines	O
and	O
c	O
columns	O
of	O
characters	O
with	O
s	O
scan	O
lines	O
per	O
character	O
requires	O
l	O
×	O
c	O
words	O
of	O
memory	O
to	O
represent	O
a	O
full	O
screen	O
of	O
characters	O
but	O
takes	O
s	O
times	O
that	O
many	O
memory	O
accesses	O
to	O
complete	O
one	O
refresh	O
cycle	O
:	O
each	O
line	O
of	O
character	O
words	O
is	O
repeatedly	O
read	O
s	O
times	O
before	O
the	O
next	O
line	O
is	O
read	O
.	O
</s>
<s>
This	O
means	O
that	O
character	O
displays	O
using	O
the	O
6845	B-General_Concept
,	O
compared	O
to	O
all-points-addressable	O
graphics	O
displays	O
of	O
the	O
same	O
resolution	O
,	O
require	O
much	O
less	O
memory	O
but	O
still	O
require	O
high	O
memory	O
bandwidth	O
on	O
the	O
order	O
of	O
the	O
bandwidth	O
required	O
for	O
graphics	O
.	O
</s>
<s>
A	O
different	O
video	O
display	B-Device
controller	O
that	O
buffers	O
one	O
whole	O
line	O
of	O
character	O
data	O
internally	O
can	O
avoid	O
this	O
repeated	O
reading	O
of	O
each	O
line	O
of	O
characters	O
from	O
the	O
display	B-Device
buffer	O
RAM	B-Architecture
,	O
reducing	O
the	O
required	O
memory	O
bandwidth	O
and	O
allowing	O
either	O
slower	O
,	O
less	O
expensive	O
memory	O
chips	O
to	O
be	O
used	O
,	O
more	O
time	O
for	O
a	O
system	O
CPU	O
to	O
access	O
the	O
memory	O
,	O
or	O
a	O
combination	O
of	O
both	O
.	O
</s>
<s>
In	O
the	O
1970s	O
and	O
early	O
to	O
mid-1980s	O
,	O
chip	O
circuit	O
densities	O
were	O
not	O
very	O
high	O
either	O
,	O
and	O
putting	O
an	O
80-byte	O
or	O
larger	O
character	O
buffer	O
into	O
a	O
chip	O
like	O
the	O
6845	B-General_Concept
might	O
have	O
enlarged	O
the	O
chip	O
die	O
by	O
50-100	O
%	O
,	O
in	O
turn	O
making	O
it	O
more	O
expensive	O
by	O
a	O
few	O
times	O
that	O
factor	O
due	O
to	O
the	O
exponential	O
growth	O
of	O
chip	O
defect	O
rates	O
and	O
the	O
consequent	O
decline	O
of	O
production	O
yield	O
with	O
die	O
size	O
.	O
</s>
<s>
Therefore	O
,	O
adding	O
such	O
a	O
character	O
buffer	O
to	O
the	O
6845	B-General_Concept
was	O
not	O
a	O
cost-effective	O
approach	O
when	O
the	O
chip	O
was	O
introduced	O
.	O
</s>
<s>
Now	O
that	O
memory	O
is	O
very	O
inexpensive	O
,	O
fast	O
memory	O
included	O
,	O
there	O
is	O
little	O
motivation	O
to	O
reduce	O
the	O
memory	O
bandwidth	O
required	O
by	O
a	O
video	O
display	B-Device
controller	O
,	O
so	O
this	O
is	O
no	O
longer	O
an	O
important	O
engineering	O
consideration	O
.	O
</s>
<s>
At	O
the	O
same	O
time	O
,	O
chip	O
densities	O
have	O
skyrocketedwhich	O
is	O
actually	O
the	O
main	O
reason	O
for	O
today	O
's	O
low	O
memory	O
pricesand	O
many	O
chips	O
used	O
in	O
computers	O
have	O
large	O
buffers	O
and	O
caches	O
;	O
a	O
chip	O
like	O
the	O
6845	B-General_Concept
designed	O
today	O
could	O
easily	O
use	O
a	O
character	O
line	O
cache	O
to	O
avoid	O
reading	O
and	O
re-reading	O
characters	O
for	O
each	O
video	O
scan	O
line	O
within	O
a	O
character	O
line	O
.	O
</s>
<s>
For	O
low-power	O
handheld	O
devices	O
,	O
which	O
would	O
be	O
the	O
main	O
ones	O
likely	O
to	O
use	O
character	O
displays	O
now	O
,	O
the	O
power	O
used	O
for	O
high-bandwidth	O
memory	O
access	O
would	O
be	O
good	O
reason	O
to	O
reduce	O
the	O
memory	O
bandwidth	O
for	O
display	B-Device
refresh	O
through	O
the	O
use	O
of	O
a	O
line	O
cache	O
in	O
the	O
display	B-Device
controller	O
.	O
</s>
<s>
If	O
the	O
character	O
address	O
is	O
used	O
to	O
look	O
up	O
a	O
character	O
reference	O
in	O
RAM	B-Architecture
and	O
the	O
row	O
address	O
to	O
index	O
a	O
table	O
of	O
character	O
graphics	O
in	O
ROM	B-Device
an	O
ordinary	O
text	B-Application
mode	I-Application
display	B-Device
is	O
constructed	O
.	O
</s>
<s>
The	O
character	O
reference	O
read	O
from	O
memory	O
must	O
be	O
combined	O
with	O
the	O
row	O
address	O
to	O
form	O
the	O
address	O
for	O
the	O
character	O
graphics	O
ROM	B-Device
,	O
with	O
the	O
character	O
reference	O
selecting	O
a	O
set	O
of	O
scan	O
line	O
patterns	O
that	O
forms	O
one	O
character	O
and	O
the	O
row	O
address	O
indexing	O
into	O
that	O
set	O
to	O
select	O
one	O
scan	O
line	O
.	O
</s>
<s>
In	O
other	O
words	O
,	O
the	O
ROM	B-Device
address	O
is	O
split	O
into	O
two	O
parts	O
in	O
order	O
to	O
use	O
the	O
ROM	B-Device
as	O
a	O
two-dimensional	O
array	O
:	O
the	O
first	O
dimension	O
selects	O
a	O
character	O
,	O
and	O
the	O
second	O
selects	O
a	O
row	O
of	O
that	O
character	O
's	O
graphic	O
pattern	O
.	O
</s>
<s>
As	O
described	O
above	O
,	O
the	O
6845	B-General_Concept
is	O
not	O
ordinarily	O
able	O
to	O
provide	O
large	O
linear	O
framebuffers	O
.	O
</s>
<s>
A	O
solution	O
is	O
found	O
in	O
the	O
Amstrad	B-Device
CPC	I-Device
,	O
which	O
combines	O
the	O
row	O
address	O
and	O
character	O
address	O
to	O
provide	O
linear	O
scanlines	O
within	O
a	O
non-linear	O
buffer	O
.	O
</s>
<s>
This	O
has	O
the	O
advantages	O
of	O
easier	O
programming	O
for	O
non-character	O
display	B-Device
and	O
easy	O
smooth	O
horizontal	O
scrolling	O
but	O
can	O
impede	O
smooth	O
vertical	O
scrolling	O
.	O
</s>
<s>
Although	O
overwhelmingly	O
compatible	O
,	O
a	O
number	O
of	O
small	O
variations	O
exist	O
between	O
the	O
6845	B-General_Concept
and	O
6545	O
.	O
</s>
<s>
Two	O
additional	O
registers	B-General_Concept
are	O
included	O
for	O
setting	O
any	O
address	O
the	O
CPU	O
wishes	O
to	O
read	O
and	O
the	O
chip	O
alternates	O
between	O
outputting	O
addresses	O
for	O
display	B-Device
generation	O
and	O
the	O
display	B-Device
set	O
for	O
CPU	O
access	O
.	O
</s>
<s>
Smaller	O
changes	O
are	O
that	O
the	O
MOS	B-Architecture
Technology	I-Architecture
and	O
one	O
variation	O
of	O
the	O
Rockwell	O
6545	O
lack	O
interlaced	O
output	O
support	O
and	O
all	O
6545s	O
include	O
an	O
optional	O
address	O
skew	O
,	O
which	O
delays	O
display	B-Device
enable	O
for	O
one	O
character	O
cycle	O
if	O
set	O
.	O
</s>
<s>
This	O
second	O
feature	O
was	O
incorporated	O
into	O
later	O
variations	O
of	O
the	O
Motorola	B-General_Concept
6845	I-General_Concept
.	O
</s>
<s>
On	O
the	O
6845	B-General_Concept
the	O
same	O
thing	O
requires	O
adjustment	O
of	O
the	O
character	O
height	O
.	O
</s>
<s>
The	O
6845	B-General_Concept
reads	O
the	O
start	O
address	O
for	O
its	O
display	B-Device
once	O
per	O
frame	O
.	O
</s>
<s>
However	O
,	O
if	O
the	O
internal	O
timing	O
values	O
on	O
the	O
chip	O
are	O
altered	O
at	O
the	O
correct	O
time	O
it	O
can	O
be	O
made	O
to	O
prepare	O
for	O
a	O
new	O
frame	O
without	O
ending	O
the	O
current	O
one	O
-	O
creating	O
a	O
non-continuous	O
break	O
in	O
generated	O
addresses	O
midway	O
through	O
the	O
display	B-Device
.	O
</s>
<s>
This	O
is	O
commonly	O
used	O
by	O
demos	O
and	O
much	O
more	O
rarely	O
games	O
to	O
provide	O
one	O
moving	O
area	O
of	O
the	O
display	B-Device
(	O
usually	O
the	O
play	O
field	O
)	O
and	O
one	O
static	O
(	O
usually	O
a	O
status	O
display	B-Device
)	O
.	O
</s>
<s>
Vertical	O
scrolling	O
appears	O
constrained	O
because	O
only	O
the	O
character	O
start	O
address	O
can	O
be	O
set	O
and	O
the	O
row	O
address	O
is	O
always	O
zeroed	O
at	O
frame	O
start	O
,	O
but	O
by	O
adjusting	O
border	O
times	O
it	O
is	O
possible	O
to	O
shift	O
the	O
position	O
the	O
framebuffer	O
is	O
shown	O
on	O
the	O
raster	O
display	B-Device
for	O
increments	O
in	O
between	O
whole	O
characters	O
.	O
</s>
<s>
With	O
drawing	O
of	O
blank	O
pixels	B-Algorithm
at	O
the	O
screen	O
edges	O
,	O
this	O
can	O
be	O
made	O
invisible	O
to	O
the	O
user	O
creating	O
just	O
the	O
illusion	O
of	O
a	O
smooth	O
vertical	O
scroll	O
.	O
</s>
