DR A Sahu Dept of Computer Science & Engineering Engineering IIT Guwahati
DR A Sahu Dept of Computer Science & Engineering Engineering IIT Guwahati
DeptofComputerScience&
Engineering Engineering
IITGuwahati
Peripheralcommunications
Display
LEDDisplay
Decoder
Generic model Genericmodel
Interfacing
CharacterDisplayMonitor p y
Decoder
GenericModel
G hi i Graphicsmonitor
Whygraphics?VectorVsRaster
Keyboard type and Interfaces KeyboardtypeandInterfaces
R
Processor
R
A
M
Peripherals:HDmonitor,5.1speaker
Interfaces : Intermediate Hardware Interfaces:IntermediateHardware
Nvidia GPUcard,CreativeSoundBlastercard
Interfaces : Intermediate Software/Program Interfaces:IntermediateSoftware/Program
Nvidia GPUdriver,SoundBlasterDriversoftware
TransmissionController:
MPU control Device Control (DMA) MPUcontrol,DeviceControl(DMA)
TypeofIOmapping
Peripheral (IN/Out) Memory mapped IO (LD/ST MV) Peripheral(IN/Out),MemorymappedIO(LD/ST,MV)
Formatofcommunication
S h (T & R ith l k) A h Synchronous (T&Rsyncwithclock),Asynchronous
ModeofDataTransfer
P ll l S i l (UART) Parallel,Serial(UART)
Conditionfordatatransfer
d lli d i l d h k Uncond.,Polling,Interrupt,Readysignal,Handshake
7 Seg 9 Seg 16 Seg 3x5 DotMatix 5x7 9x11 7Seg 9Seg 16Seg 3x5DotMatix 5x79x11
DotMatrixDisplayPanel
25x80charactermonitor
Di l
Data
ASCII/BCD
Decoder
Or
Memory
Display
Monitor/LEDs
TimetoDecode TimetoDisplay
Data to 7 Segment Decoder Datato7SegmentDecoder
a
a
D 1
1
0
1
1
b
f
Common
Cathode
b
f
g
C
B
A
0
0
0
0
1
1
5
5v
1
1
1
5
5v
c
e
g
c
e
d
LT
RBI
BI
5V
1
0
1
5V
1
1
1
d
BI
Decoder
RBO
Data to 7 Segment Decoder Datato7SegmentDecoder
Blank Blank
abcdefg
DCBA
RBIRBO
abcdefg
DCBA
RBIRBO
abcdefg
DCBA
RBIRBO
abcdefg
DCBA
RBIRBO
abcdefg
DCBA
RBIRBO
5V
1 0 0 1 1
0000 0000 0011 0000 0111
40Bitdataline
2
0
1
2
3
4
Mod5
Counter
8Bitdataline
Data1 Data1
Data2 Data2
Data3 Data3
Data4 Data4
Data0
7SegmentDecoder
RAM
590
1:NDecoder
Counter
Write a program to display contents of B C D WriteaprogramtodisplaycontentsofB,C,D
andEregistertoLEDdisplay
Write to buffer memory to display to 7 Seg Writetobuffermemorytodisplayto7Seg.
LEDs
U dd FC H FD H FE H d FF H UseaddressFCH,FDH,FEHandFFHto
display
Ctr
A
7
A
6
A
5
A
4
CS WR RD
4
A
3
A
2
LEDs
Buffer
Memory
Address
line
MPU
A
1
A
0
Data
lines 7Seg.
Decoder
74LS373
LE
D
7
D
6
D
5
Decoder
74LS373
Latches
D
4
D
3
D
2
D
1
D
0
IO/M IO/M
RD
WR
Interface program to Display content of B C D InterfaceprogramtoDisplaycontentofB,C,D
andEafter1SecDelay
DIS: MVI A,B
OUT FCH
MVI A C MVI A,C
OUT FDH
MVI A,D
OUT FEH OUT FEH
MVI A,E
OUT FFH
CALLDELAY;1secdelay y
JMPDIS;
Row
Ctr
Col
Ctr
CLK>50Hzx25x80
0 1 2 3 4 .. 78 79
C A T
F I R E
01234..7879
0
1
2
25x80charactermonitor
23
24
A
Decoder
Or
ROM
Decoded
Bit
A
ROM
Memory
Bits
Counter
When
C=0
Ready
CS WR
CharFrame
Buffer
Memory
Address
line
StreamBuffer
dd ( )
Data
lines
Address(r,c)
DelayofMonitoris1/50Sec,AfterEvery50
Seconditmakesready
F t b ff it it t F b ff ft FromstreambufferitwritestoFramebufferafter
gettingcommand.(Flushstreamcommand)
LEDisveryhighspeed
You can write to LEDs at very high speed YoucanwritetoLEDsatveryhighspeed
Displaymeantfortoseesomething(Isitgood?)
30 F /S i h h f 30Frames/Secismorethenenoughfor
humaneye(>30blinkmakehumaneyeFixed)
Noofblink>30Hz
HumancannotdifferentiateON/OFFstate,itwill
beseenASONstate
Videodisplaymakedefault3060Frame/Sec
Monitorrunatspeed3060Frame/Sec
Speed is fixed (60Frame/Sec) Speedisfixed(60Frame/Sec)
f or ( i =0; i <10000; i ++) { ( ; ; ) {
pr i nt f ( Hel l oWor l d) ;
}
$ $a.out
$a.out >outputfile
$a.out >/dev/null
Chardisplay(80x25char,5x7pixel=400x175)
CRTMonitor(400x600,640x480,600x800)
LCD Monitor (1024x768 1280x1024 ) LCDMonitor(1024x768,1280x1024,)
Graphicsvisuallymoreappealing
DisplayLine,Circle,Rectangle,Curve,Polygon
Characterusingthisprimitives
Truetypefont
REDARROW
Circle Circle
Row
Ctr
Col
Ctr
CLK>1024x768x50Hz
0 1 2 3 4 .. 1023 01234..1023
0
1
2
1024x768PixelLCD
767
8x3=24Bits
FrameBuffer
R B G
Refreshscreen50timeaSec
PixelsinFrame
Buffer
1BitPerPixels
Pixelson
theScreen
Graphical representation of 1 bit color Graphicalrepresentationof1bitcolor
PixelsinFrame
Buffer
15BitPerPixels
Pixelson
theScreen
Graphicalrepresentationof15bitcolor p p
PixelsinFrame
Buffer
24BitPerPixels
Pixelson
theScreen
Graphicalrepresentationof24bitcolor p p
1 bitcolor 8bitcolor 16bitcolor
Vectorgraphics: g p
Usegeometricalprimitivesbased
onmathematicalequations,to
represent images in computer representimagesincomputer
graphics
Points,Lines,Curve,shapesor
Polygons Polygons
RasterGraphics:Complementary
toVectorGraphics p
Representationofimagesasan
arrayofpixels
photographic images photographicimages
StoretheprimitivesintheFILE
Word,Photoshop,Xfig,GNUPlot,PS,HTMLTag
Raster:StorethePixelvaluesintheFILE
BMP,PNG,JPG
Atruntime,processtheprimitiveand At runtime, process the primitive and
generatePixeltorasterthescreen(Display)
Who do this? Whodothis?
Software
GPU (hardware accelerated routine) GPU(hardwareacceleratedroutine)
Computerfontformats:TrueTypeFont
Where each letter is created from Bzier curves WhereeachletteriscreatedfromBzier curves
Manyvarietiesoffontforacharacter
Units
Pointswithunit
andcurve
properties are propertiesare
stored
GPU:specializedprocessorthataccelerates
3Dor2Dgraphicsprimitivesoperations
LotsofFloatingpointoperations g p p
AcceleratesPrimitives
Line circle polygon mesh projection sphere Line,circle,polygon,mesh,projection,sphere,
3Dapplication
3DAPI:
OpenGL
/
3DAPICommands
CPU GPU B d
/ DirectX/3D
CPUGPUBoundary
GPUCommand
&DataStream
Assembled
Pixel
i
Pixel
U d t
GPU
Command
Primitive
Assembly
Rastereisation
Interpolation
Raster
Operation
Frame
Buffer
VertexIndex
Stream
Assembled
polygon,line
&points
Location
Stream
Updates
Command
y p p
Programmable
Programmable
Transformed
Fragments
Rastorized
Pretransformed
Fragments
transformed
Vertices
Pretransformed
Vertices
Programmable
Fragment
Processors
Programmable
Vertex
Processor
Memory
Vertices
( )
y
System
Vertex
(x,y,z)
Vertex
Vertex
Processing
Shadder
Pi l
y
Texture
Memory
Pixel
Processing
Pixel
Shadder
Frame
Buffer
Pixel
R G B R,G,B
RSGaonkar,MicroprocessorArchitecture,UnitIIpreface,
Chapter14and17 p