Download presentation
Presentation is loading. Please wait.
2
EC6703 EMBEDDED AND REAL TIME SYSTEMS
3
UNIT V CASE STUDY Data compressor Alarm Clock Audio player
Software modem Digital still camera Telephone answering machine Engine control unit Video accelerator.
4
ALARM CLOCK
5
Alarm clock interface Alarm on Alarm off buzzer PM Alarm ready light
set time set alarm hour minute button
6
Operations Set time: hold set time, depress hour, minute.
Set alarm time: hold set alarm, depress hour, minute. Turn alarm on/off: depress alarm on/off.
7
Alarm clock requirements
8
Alarm clock class diagram
1 1 1 1 Lights* Display Mechanism 1 1 1 Buttons* Speaker* 1
9
Alarm clock physical classes
Lights* Buttons* Speaker* digit-val() digit-scan() alarm-on-light() PM-light() set-time(): boolean set-alarm(): boolean alarm-on(): boolean alarm-off(): boolean minute(): boolean hour(): boolean buzz()
10
Display class Display time[4]: integer alarm-indicator: boolean
PM-indicator: boolean set-time() alarm-light-on() alarm-light-off() PM-light-on() PM-light-off()
11
Mechanism class Mechanism Seconds: integer PM: boolean
tens-hours, ones-hours: boolean tens-minutes, ones-minutes: boolean alarm-ready: boolean alarm-tens-hours, alarm-ones-hours: boolean alarm-tens-minutes, alarm-ones-minutes: scan-keyboard() update-time()
12
Update-time behavior update seconds with rollover
display.set-time(current time) F Time >= alarm and alarm-on? Rollover? F T T update hh:mm with rollover alarm.buzzer(true) PM->AM AM->PM PM=true PM=false
13
Scan-keyboard behavior
Set-time and not set-alarm and hours compute button activations Alarm-on Increment time tens w. rollover and AM/PM alarm-ready= true Alarm-off alarm-ready= false alarm.buzzer(false) Increment time ones w. rollover and AM/PM save button states Set-time and not set-alarm and minutes
14
System architecture Includes: Two major software components:
periodic behavior (clock); aperiodic behavior (buttons, buzzer activation). Two major software components: interrupt-driven routine updates time; foreground program deals with buttons, commands.
15
Interrupt-driven routine
Timer probably can’t handle one-minute interrupt interval. Use software variable to convert interrupt frequency to seconds.
16
Foreground program Operates as while loop: while (TRUE) {
read_buttons(button_values); process_command(button_values); check_alarm(); }
17
Testing Component testing: System testing:
test interrupt code on the platform; can test foreground program using a mock-up. System testing: relatively few components to integrate; check clock accuracy; check recognition of buttons, buzzer, etc.
19
Audio players Audio players may use flash, hard disk, or CD for mass storage. An MP3 player performs three basic functions: audio storage, audio decompression,and user interface. Decompression requires small amount of CPU: 10% of ARM7. File system must be compatible (FAT). Cirrus CS7410
20
Digital still cameras DSC must determine exposure before taking picture. After taking picture: Improve image quality. Compress. Save as file.
21
Digital still camera architecture
DSC uses CPU for general-purpose processing, DSP for image processing. Internal memory buffers the passes on the image. Display is lower resolution than image sensor. Image must be down sampled.
22
Image capture Before taking picture: Determine exposure.
Determine focus. Optimize white balance. Bayer pattern
23
Image processing Must perform basic processing to get usable picture:
Bayer->RGB interpolation. DSCs perform many functions formerly performed by photoprocessors for film: Image sharpening. Color balance.
24
File management EXIF standard gives format for digital pictures:
Format of data in a file. Directory structure. EXIF file includes: Image (JPEG, etc.) Thumbnail. Metadata (camera type, date/time, etc.)
25
Accelerators Example: video accelerator
26
Concept Build accelerator for block motion estimation, one step in video compression. Perform two-dimensional correlation: f2 Frame 1 f2 f2 f2 f2 f2 f2 f2 f2 f2
27
Block motion estimation
MPEG divides frame into 16 x 16 macroblocks for motion estimation. Search for best match within a search range. Measure similarity with sum-of-absolute-differences (SAD): S | M(i,j) - S(i-ox, j-oy) |
28
Best match Best match produces motion vector for motion block:
29
Full search algorithm bestx = 0; besty = 0; bestsad = MAXSAD;
for (ox = - SEARCHSIZE; ox < SEARCHSIZE; ox++) { for (oy = -SEARCHSIZE; oy < SEARCHSIZE; oy++) { int result = 0; for (i=0; i<MBSIZE; i++) { for (j=0; j<MBSIZE; j++) { result += iabs(mb[i][j] - search[i-ox+XCENTER][j-oy-YCENTER]);
30
Full search algorithm, cont’d.
} if (result <= bestsad) { bestsad = result; bestx = ox; besty = oy; }
31
Computational requirements
Let MBSIZE = 16, SEARCHSIZE = 8. Search area is in each dimension. Must perform: nops = (16 x 16) x (17 x 17) = ops CIF format has 352 x 288 pixels -> 22 x 18 macroblocks.
32
Accelerator requirements
33
Accelerator data types, basic classes
Motion-vector Macroblock Search-area x, y : pos pixels[] : pixelval pixels[] : pixelval PC Motion-estimator memory[] compute-mv()
34
Sequence diagram :PC :Motion-estimator compute-mv() Search area
memory[] memory[] macroblocks memory[]
35
Architectural considerations
Requires large amount of memory: macroblock has 256 pixels; search area has 1,089 pixels. May need external memory (especially if buffering multiple macroblocks/search areas).
36
Motion estimator organization
PE 0 search area network PE 1 comparator ctrl Address generator ... Motion vector macroblock network PE 15
37
Pixel schedules M(0,0) S(0,2)
38
System testing Testing requires a large amount of data.
Use simple patterns with obvious answers for initial tests. Extract sample data from JPEG pictures for more realistic tests.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.