lec09

32
Dr A Sahu Dept of Computer Science & Engineering Engineering IIT Guwahati

Upload: mohammad-seemab-aslam

Post on 19-Jul-2016

212 views

Category:

Documents


0 download

DESCRIPTION

Doc

TRANSCRIPT

Page 1: Lec09

Dr A SahuDept of Computer Science & 

EngineeringEngineering IIT Guwahati

Page 2: Lec09

• Peripheral communications • Display• LED Display

– Decoder – Generic model– Generic model– Interfacing

• Character Display Monitorp y– Decoder– Generic ModelG hi i• Graphics monitor – Why graphics? Vector Vs Raster

• Keyboard type and Interfaces• Keyboard type and Interfaces

Page 3: Lec09

RProcessor 

RAM

• Peripherals :  HD monitor, 5.1 speaker 

• Interfaces : Intermediate HardwareInterfaces :  Intermediate Hardware – Nvidia GPU card,  Creative Sound Blaster card 

• Interfaces : Intermediate Software/Program• Interfaces : Intermediate Software/Program– Nvidia GPU driver , Sound Blaster Driver software

Page 4: Lec09

• Transmission Controller:MPU control Device Control (DMA)– MPU control, Device Control (DMA)

• Type of IO mappingPeripheral (IN/Out) Memory mapped IO (LD/STMV)– Peripheral (IN/Out), Memory mapped IO (LD/ST,MV)

• Format of communicationS h (T & R ith l k) A h– Synchronous (T & R sync with clock), Asynchronous

• Mode of Data Transfer P ll l S i l (UART)– Parallel, Serial  (UART)

• Condition for data transfer d lli d i l d h k– Uncond., Polling, Interrupt, Ready signal, Handshake

Page 5: Lec09

7 Seg 9 Seg 16 Seg 3x5 DotMatix 5x7 9x117 Seg 9 Seg 16 Seg 3x5 DotMatix 5x7                9x11 

Dot Matrix Display Panel 

25x80 character monitor 

Page 6: Lec09

Di lData

ASCII/BCDDecoder

Or Memory 

Display

Monitor/LEDs

Time to Decode    Time to Display

Page 7: Lec09

• Data to 7 Segment DecoderData to 7 Segment Decoder

a

aD11

0

1

1b

fCommon Cathode

b

f

g

C

B

A

0

0

0

0

1

1

5

5v

1

1

1

5

5v

c

e

gce

d

LT

RBI

BI

5V

10

15V

11

1

dBI

Decoder

RBO

Page 8: Lec09

• Data to 7 Segment DecoderData to 7 Segment Decoder

Blank Blank

a   b   c   d   e    f   g

D   C   B   A

RBI                    RBO

a   b   c   d   e    f   g

D   C   B   A

RBI                    RBO

a   b   c   d   e    f   g

D   C   B   A

RBI                    RBO

a   b   c   d   e    f   g

D   C   B   A

RBI                    RBO

a   b   c   d   e    f   g

D   C   B   A

RBI                    RBO

5V

10 0 1 1

0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 1 1 1

Page 9: Lec09

40 Bit data line

20 1 2 3 4Mod 5 

Counter 

8 Bit data lineData 1 Data 1 Data 2Data 2Data 3Data 3Data 4Data 4

Data 0

Page 10: Lec09

7 Segment Decoder

RAM

590

1:N Decoder

Counter

Page 11: Lec09

• Write a program to display contents of B C DWrite a program to display contents of B,C,D and E register to LED display

• Write to buffer memory to display to 7 Seg• Write to buffer memory to display to 7 Seg. LEDs

U dd FC H FD H FE H d FF H• Use address FC H,FD H,FE H and FF H to display

Page 12: Lec09

Ctr

A7A6A5A4

CS WR RD

4A3A2

LEDsBuffer Memory

Address lineMPU

A1A0

Datalines 7 Seg.

Decoder74LS373

LED7

D6

D5 Decoder74LS373Latches

D4

D3

D2

D1

D0

IO/MIO/MRD

WR

Page 13: Lec09

• Interface program to Display content of B C DInterface program to Display content of B,C,D and E after 1 Sec Delay 

DIS: MVI  A,BOUT  FCHMVI A CMVI  A,COUT FDHMVI A,DOUT FEHOUT FEHMVI A,EOUT FFHCALL DELAY              ;1sec delay yJMP DIS;

Page 14: Lec09

Row Ctr

ColCtr

CLK > 50Hzx25x80

0 1 2 3 4 ….. 78 79C A T

F I R E

0     1   2    3    4   ….. 78  79012

25x80 character monitor 2324

A

DecoderOr 

ROMDecoded 

BitA ROMMemory 

Bits

Page 15: Lec09

Counter

When C=0Ready

CS WR

Char FrameBuffer Memory

Address line

Stream Buffer

dd ( )

Datalines

Address (r,c)

• Delay  of Monitor is 1/50 Sec, After Every 50 Second it makes readyF t b ff it it t F b ff ft• From stream buffer it writes to Frame buffer after getting command. (Flush stream command)

Page 16: Lec09

• LED is very high speed You can write to LEDs at very high speed– You can write to LEDs at very high speed

– Display meant for to see some thing (Is it good?)

30 F /S i h h f• 30 Frames/Sec is more then enough for human eye (>30 blink make human eye Fixed)

• No of blink > 30Hz – Human can not differentiate ON/OFF state, it will be seen AS ON state

• Video display make default 30‐60 Frame/Sec

• Monitor run at speed 30‐60 Frame/Sec

Page 17: Lec09

• Speed is fixed (60Frame/Sec)Speed is fixed (60Frame/Sec)

for(i=0;i<10000;i++){( ; ; ){printf(“HelloWorld”);

}

$• $ a.out• $ a.out > outputfile• $ a.out > /dev/null

Page 18: Lec09

• Char display (80x25 char, 5x7pixel=400x175)

• CRT Monitor (400x600, 640x480,600x800)

• LCD Monitor (1024x768 1280x1024 )• LCD Monitor (1024x768,1280x1024,…)

• Graphics visually more appealing 

• Display Line, Circle, Rectangle, Curve, Polygon– Character using this primitives

– True type fontRED ARROW

CircleCircle

Page 19: Lec09

Row Ctr

ColCtr

CLK > 1024x768x50Hz

0 1 2 3 4 ….. …10230     1   2    3    4   ….. …1023012

1024x768 Pixel LCD 767

8x3=24 Bits

Frame Buffer

R B G

Refresh screen 50 time a Sec 

Page 20: Lec09

Pixels in Frame Buffer

1 Bit Per Pixels Pixels on the Screen

Graphical representation of 1 bit colorGraphical representation of 1 bit color 

Page 21: Lec09

Pixels in Frame Buffer

15 Bit Per Pixels

Pixels on the Screen

Graphical representation of 15 bit color p p

Page 22: Lec09

Pixels in Frame Buffer

24 Bit Per Pixels

Pixels on the Screen

Graphical representation of 24 bit color p p

Page 23: Lec09

1‐ bit color 8‐bit color 16‐bit color

Page 24: Lec09

• Vector graphics: g p– Use  geometrical primitives based on mathematical equations, to represent images in computerrepresent   images in computer graphics 

– Points, Lines, Curve, shapes or PolygonsPolygons

• Raster Graphics: Complementary to Vector Graphicsp– Representation of images as an array of pixels photographic images– photographic images

Page 25: Lec09

• Store the primitives in the FILE– Word, Photoshop, Xfig, GNUPlot, PS, HTML Tag

• Raster: Store the Pixel values in the FILE– BMP, PNG, JPG

• At runtime, process the  primitive and At runtime, process the primitive andgenerate Pixel to raster the screen (Display)

• Who do this?• Who do this?– Software  

GPU (hardware accelerated routine)– GPU (hardware accelerated routine)

Page 26: Lec09

• Computer font formats: TrueType Font – Where each letter is created from Bézier curvesWhere each letter is created from Bézier curves

• Many varieties of font for a characterUnits

Points with unit and curve 

properties areproperties are stored

Page 27: Lec09

• GPU : specialized processor that accelerates 3D or 2D graphics primitives operations

• Lots of Floating point operationsg p p

• Accelerates Primitives – Line circle polygon mesh projection sphereLine, circle, polygon, mesh, projection,  sphere, 

Page 28: Lec09

3D application

3D API: OpenGL

/

3D API Commands

CPU GPU B d/DirectX/3D CPU‐GPU Boundary 

GPU Command& Data Stream

AssembledPixel 

iPixel U d t

GPU Command

PrimitiveAssembly

RastereisationInterpolation

RasterOperation

Frame Buffer

Vertex Index Stream

Assembled polygon, line & points

Location Stream

Updates 

Command y p p

ProgrammableProgrammable

Transformed Fragments

RastorizedPretransformedFragments

transformedVerticesPretransformed

Vertices

Programmable Fragment Processors

ProgrammableVertex

Processor 

Page 29: Lec09

Memory Vertices( )

ySystem 

Vertex

(x,y,z)

Vertex  Vertex Processing Shadder

Pi l

yTexture Memory 

Pixel Processing

Pixel Shadder

Frame Buffer

PixelR G BR, G,B

Page 30: Lec09
Page 31: Lec09

• R S Gaonkar, “Microprocessor Architecture”, Unit II preface, Chapter 14 and 17p

Page 32: Lec09