Embedded System Design First Edition Frank Vahid instant download
Embedded System Design First Edition Frank Vahid instant download
pdf download
https://ebookname.com/product/embedded-system-design-first-
edition-frank-vahid/
https://ebookname.com/product/embedded-system-design-a-unified-
hardware-software-introduction-frank-vahid/
https://ebookname.com/product/digital-design-with-rtl-design-
vhdl-and-verilog-2nd-edition-frank-vahid/
https://ebookname.com/product/rapid-system-prototyping-with-
fpgas-accelerating-the-design-process-embedded-technology-1st-
edition-cofer/
https://ebookname.com/product/weather-toys-building-and-hacking-
your-own-1-wire-weather-station-3rd-edition-tim-bitson/
Cat Owner s Home Veterinary Handbook 3rd ed Edition
Debra M Eldredge
https://ebookname.com/product/cat-owner-s-home-veterinary-
handbook-3rd-ed-edition-debra-m-eldredge/
https://ebookname.com/product/debian-gnu-linux-bible-1-cd-with-
debian-gnu-linux-2-2r2-edition-steve-hunger/
https://ebookname.com/product/test-your-english-vocabulary-in-
use-advanced-south-asian-edition-michael-mccarthy/
https://ebookname.com/product/the-masks-of-god-primitive-
mythology-joseph-campbell/
https://ebookname.com/product/build-your-own-wicked-wordpress-
themes-1st-edition-alan-cole/
Lean Six Sigma international standards and global
guidelines Second Edition Vanzant Stern
https://ebookname.com/product/lean-six-sigma-international-
standards-and-global-guidelines-second-edition-vanzant-stern/
Embedded System Desig~
A Unified Hardware/Software Introduction
· Frank Vahid
Dep~ent ~f Corrtpuu{Scfon~ an4 Engineering
University of California, Riverside ·
www.compsciz.blogspot.com
. .~ . : . ·· ·: .!_, :
www.compsciz.blogspot.in
-~
·~
l
:!
_j
:.,1
j
'l
I
I
-;· .:.-· -~·-· ,.,I
l' To my world: Amy. Eric, Kelsi and Maya, and to the memory ofour
:j sixth member, VahidAminian. --'- FV ·
!
109876
www.compsciz.blogspot.in
[I
~
~
";j
•I
~
:1
1
I
;j
;;
1
ii
l
:\ Preface
·~
·I
·•1
·1
,1
,j
,l ·.Purpose
. \
1 Embedded computing systems have gr<>wn tremendously irt recent years, not only in their
j· popularity, but also in'. their complexity: This coniple,ufydemands a new type cif designer, one
.i . who can easily cross the traditional borderbetw<ien' hardwaredesign and software design.
i ·After fuvestig~ting the availability' of:courses' lllld textbooks, we felt a new course .and
~. accompanying textbook were necessary· tifintioduce .embedded coniputing system design
.
•.,1 using a lliiified view of software and hard\\'lire; This textbook portrays hardware and software
1 not as different domains, · but :·rather as two mlplementation ·options along a continuum of
l options varying ui thefrdesign metricsf like cost;:peiformance; power, size, and flexibility.
~ · · Three important treridS have 'riiade such a· uhified view posmble. First, integrated circuit
~ (IC) capacities rui:ve increased to the point ~t both software processors and custom hardware
;! ' a
processors now ~rnnionly cod:ist on smg!e'It:'Second,quality compilers and-program size
\l. increases have led to the conunon use ofprocciisor~independent C, C++; and Java compilers
and ··integrated i design ' eilWoiurients ·1(Il)Es) in ' embedded system ' design, significantly
/j decreasing the importance of the· focus .on microprocessor internals· and assembly language
:1 programming that dominate most existing embc;dded ~stem courses
and textbooks: Third,
r1 ·syn*eSiS . teclmology has O~an~ ;JC) ; the,,ip!)iilt: $at synthesis .(OOlS .have ·become
! 1 ·.commonpla~ in the d~ign :~f .d,igitalJ1iµd~iµ-e:_; SyrithesiJ; tools achieve nearly the same for
i\ .• hardware de~ign 'as co~il~rfacbJey~.J~:~flw~:des~gn;) 'hey allow the designer to describe
-·- ---·--- -·T--· -· .. · desireit fwtcµ<>.naijty in',.a-Wih~1~e1 , pi::<1gram.miijg.~g\lage; and they .then automatica11y
k,1 .gel:!€:rate ~ effi~ie,qt -~~~to,Jn~),la¢wiµ-e. pr~r -implementation. The firsttrend inakes the
J · past,separation ofs<>ftw~e: 3114,har,4~M,e;!f~gr,;neaI'ly)ntpossibk Fortunately; tbe second
~ ' ancfthird trends enable tbeir ,lJJJ.ifi¢ d"'5igP,; bY.-l!lrnil!g embedded system design. atits highest
·~ .Jevel; into.the problent ofse,lectj11.g _lµld pn;igraimning (for so,ftware), designing (for hardware),
·il lµl~ ,~te.~tiilg"pJ<>CeS§q~t -i- ;s ·;t .·) : 1-c_;·,:. 'i,:,::-,:r;
·~} ... .,..........~.·.. ;·... : :,·(: i).: d ·::·,~_-;·~. ·: - :
·cQverage _ . ......-. . ._
· .·.._· . ., . · ..
:~
i .. .-
'"
, : .· .·.;Etl=iiaT:=~~s
.
~ . \ . . . .
j'l -,--_,..,..:__ _ _ _ _ _ _ _ _ _ __:__ _ _ _ _ _ _ _ _ _ _ ___,;__~,
}1 ..... · .· ,. .. J)!t: . .
. ~ -~~d~SysterrtOlisign .VII . . :\?
"
-----··--·- . . . . -
-l.i:. - - - -------- -- -------------
www.compsciz.blogspot.in
r
f - - - - ~ - - - - - - - - - , -- - - - - - - - - - - - - - - - - ~ - -
Preface
· ,:.
\'
environment, again usually available fot free or at low cost, may be useful_
~ -k
www.compsciz.blogspot.in
I
-"""---'----'-----------------------'------:--:--::-,-~-~---:---:----:-------~,-:-----.:......:_
•'Pr~tice .
I
__ --'-~-
Preface
At UCR,. our labs are based on the 805 L microcontroller.and Xilinx FPGAs. We use the About the Authors
Keil C compiler for the microcontrollei", Xilinx f'.oiirii:fatioit·Ejq>ress synthesis software for the I Frank Vilhid is an Associate Professor in the Department of Computer Science and
FPGA, and a~~elopm.ent board from·Xess Co.·iwfatfo."rifofpfotdtyping- the board ~o.ntains .··Ii
Engineering at the University of California, Rivenside, which he joined in 1994. He is also a
both an 805Land lilt FPGA. We also use an 8051 .einulator and stand-alone 8051 chips from f?Culty member of the Center for Embedded .Computer Systems at the University of·
Philips . .. . .. . California, · Irvine. He received his B.S. in Computer Engineering from the University of
We have provided extensive information onour lab setup and assignments on the book's l Illinoi~, UrQana/Champaign, and his MS. and Ph.D. degrees in Computer Science from the
Web page: Thus, while the book's microprocei,sor independence enables instructors to choose University of <;alifotnia, Irvine, where he was recipient of the Semiconductor Research
any lab environment, we have sti_ll prciv/4¢ instructors the option of obtaining extensive Corpcrat.ion Graduate Fellowship. He was an engineer at Hewlett Packard and has consulted
Online assistancejn
~-- ----·· . developing
. .
an
accompanyi~g
':·
laboratory, ; .,
for nUmerous companies,.including NEC -~d Mot!-)rola. He is co-author of the ~uate-level
textbookSpec{fication and Design of Embedded Sy_stems (Prentice-Hall, 1994). He has been
. ..• Adtti"iio11a1Matena1s 1.:' •. .. . · program chair and general chair for both the Inteniafional Symposium on System Synthesis
A.;cl> ' Jage has been established to 'tie used' dn )~onjunction · with the book: and for the International Symposium on Hardware/Software O;xlesign. He has been an active
researcher in.embedded system design since 1988, with more than 50 publications and several
·'tittp:liwww.cs.ucr.edu/esd. This Web page contains supplementary maierialand links for
eac;h c:bilpter. It also contains a setof1~1Jre sl\4es inf\1ic:wspf(PowerPoint fofillllt; because · . best papei-\awards, including an IEEE Transactions on VLSI best paper award in 2000. His
the book itself was done entirely in Microsoft Word," the 1'gures in the PowerPoint slides are research .interests are in einbedded system architectures, low-power design, and design
. ~owerPoint drawings (rather than imported gnlphics), and .thtis can be modified as desired by I methods for syste111-on-a-chip.
-mstructors-:,· ...·, . • , ·- . ·· -·., - .,.. ·.-.···.··· ..... ,.. ...,.,....· ,··. ..... , . ·. ··· .,. ,
., · ::. f ~~~6r~, the .W~b page c~~t.tin~ an•ixttn~iveJab ;rri~,um. to accompany this 0
, I an
Tony Givargis is. Assistant Professor in the Department of Infonnatiqn and Computer
Science and a member cif the Center for Embedded Computer Systems at the University of -
.text.bo_
:__: 9k, ~e_I"_ 30 _lab e_xercises_,_ 1_·ndu4i_:,n_ig ,de.Jail~ _,. 4e_sc_·.. .n_·ption_.~;,SC .. heQta.tics, and co~plete.or ., California,.lrvit!e;He.received his B.S. and Ph.D ..degrees .from the Univ~ ofCalifomia,
pru:(lil,I soh1t19ns, ·can be fo.und there. .11i.e ewfqses.i~e prgaiµzed by· c~pter, .startrng with .
Riverside; where-he received the Department of Computer Science Best Thesis award and the
v_ery_. ~j~
. P__ 1e_ •_ex_e.rc·i.~. an_d ~ea
-· dingt_o p:ro___gf·-~.ss-jv~!r,m_
,_._P_.•_~_~.:,9~m
-. P
... '_. .ex_·. _n_~- F·.o_._re_~p.le_._' Chapter •1
Q.
UCR~le_g~ofEn~(;¢ring Outstanding Student award, and where he was recipient of the
2',sexen::1~,sta,rtw1th a sunple bhnlciiJ.g.lig\lk;.,mcJ en!i,,~1t.h asoda.cmaclune_colltroller and a ·
· calculator: Appendix A provides fuJ1her information on.our Web page. .· ' I · GAANN Grad11ate .fellowship, a MICRO fellowship, and a Design Automation Conference
.. Ack~Jtv,~d~~ents' •. .·....•. .• . ' .. ' ' ... . .• .· . . .•.·. I scholarsliip. As a consultant, he has developed numerous embedded systems for several
companies; ranging !from an irrigation management system to a GPS-guided, self-navigating
· automobile. He h~'published more than 20 research.papers in the embedded systems field.
We ar~ g~tetul to nu~~rous indfviduals ~or their ~si~ce in _developirif ~1s book. Shar~n ., His research interests include embedded and real-time system design, low power design, and
...· flµ ,o(;Notre .Pame,.Nil<ll Putt o(lJG lryllle;,M4 $111J.t11.,.l;!~bi of UC ·Pavis and Synphc1ty . .proce5$or/system'-on-a-chip architectures.
··r~Et;~~~d~==;=;ru,::J
..; '.~ii~~:;1~~~t:f!~~~~%:tt!~i!::i::~:~~a~it;;~~r~:a~tJ ·
.._J9yer~~4e (;()ntributed mu~h ·qf thed~pter .o!),<;011trol sy$tem,s., Karen Jicl;iechter,<;onyerted our ·• ·
.. ·. ·\.',Oyeraes/~ jd~ WPt,.11e irtiJ.i;tl 3_.,D scepe; ~ e,.gepei_o~;4W¥1ti.QttS'..9f ~Q5 L~uip!);lent from .
... Pamti~ ,..Seijucondµctors. and of FPOA <;quip,roent,Jro01 .Xiliilx,-were ;a big assistance-".
. Lilcewjse/ a National Science .Fqund!ltio11 CAR.E;iiR .fiWar,d. supppn,ed •some· of tl.lis book's :I
.. ,cJeve!9p1lle11t.,We thank Caroline Sieg .at Wj,ley,:f<>r,over~ipg ,$<; .·l)wk's -pro<luction and J
Madelyn Lesure for overseeing th~ cover d~ign. [email protected]; '\Y.!uu;e id~_ply( grat€:ful to -~ill :i•.
··••·. ~..1;:=~::rit~;~;-:,t:':~ ; :·~-.·fa'.i· . I
.. , i~~-";----"--'--'-----.--'--'---.....:..,.----_.:._~_.:.__,__~--------'_.:._.::.._"-----,-
~--~----------------------....,,,_.:c:---......,...~~........,...-·.,..,·~··'-··--"·· .Eni~eddedSystem O~ign xi
X .g~tie~ded Syste.m 6~~igrl .J .· ..~..:·~.~.
www.compsciz.blogspot.in _________________ __
- - - - ---,-~ - --=========aao!!!i!l!li!!b...-....:..._. - - - ~ ~"""'~ .......
~ · ··.··· -··
:i
."·,
"THIS .BOOK IS FOR SA.LE: ONLY IN THE COUNTRY TO WHICH IT IS FIRST CONSIGNED .
BY JOHN WILE"'.,& SONS (ASIA) PTE LTD AND MAY NOT BE RE-EXPORTED" .
Contents
...... .
vii
vii
vii
viii
~~ --•/4
. lff).~-_.._. ix
X
X
: ~..-'.· . ·. · . .
xi
'
1
l
4
'. 4
6
.7
8
9
9
I 10
12
13
,1 ·\ ····· 13
jl
i ..
·13
i 'i·
.•14"· ·
II, · · 14
· . .· ·,_, · .. ..
\ ·-:J 6·
-;11
18
www.compsciz.blogspot.in
Contents
. ''· :\is0enfi~~tio/
i :'": . '
1: ·. l
More Productivity Improvers
Trends·
!9 j\ 3.4
Superscalar and VLIW Architectures
Programmer's View 61
. 61
19 Instruction Set . : ,;···
1.6 Trade-offs J, 62
Program and Data.Memory Space
Design Productivity Gap _27. Registers
64
L7 Summary and Book Outlin~ .• 24 I/0 , 64
I. 8 Re rences and Further Reading · 25 j Interrupts
65
25 a 65
. . --~ -Single=-Purpose Processors:Hardware ·29 J Ex.ample~ Assembly-Language Programming ofDevice·Drivers · 66
~~
~
29
I
i
Operating System · · ·
67
3. 5 ·Development Environment
· .2 Co mational Logic 30 l 69
Tran . tors andLogic Gates ·,. ;,. 30
32
I Design Flow arid Tools
£~ample: Instruction-Set Simulator for a Simple Proces'sor
' 69
71
B 1c Combinational Logic Design J Testing and Debug}iing, .. ·
. T-LeveLCombin~tional Components .., ,., . 33 l 71
3.6 · Application-Specific Instruction-Set Processors (ASIPs)
2.3 · 1 :sequential Logic 34
. l1 Microcontrollers ·
74
·
Flip~flops,/ .' , . .. . . 34 i 74
'"RT~te:vel,'Sequential Components
35
I Digital Signal Processors (DSP)
Less-General ASIP Environments
75
75 ,
~
- :__--~-,.Js~e;
·q·~u.·ien~t~ia.·~1~L~o~~ic~ .· ~·..i-;;~:
·D~e~s~i~n~; · ;·.··;·.'·.~·.·~/~~·,~~:"~·);>:•::::-~
Custom Single-Purpose Processor De~rgn ··.'"· ·· ·,, ·· '
~ ;36
38 ,
,!.
3. 7 ~?'·--selecting a ~Microprocessor ···· ··
75
3. 8 .. General~Pu~~b-se Processor Des1g°*
2.5 RT-Level Custom Single;.Pu ose,Proce . . 44 j 3.9 Sumrhary • : 0 • • - : ·
77
. ttmtzmg ·nstom Singl¢"'Prirpose Processors :.-. ·47 i 80
Optimizing·the Origina!)Prograh1''' · · . • . < 47 ! 3. JO Refer~nces and Further Reading ·
_ 3) I Exefdises · . :- >. -~ >':. ·· ·
.
. . . •.· .
80
81.-
Optintizirig the FS~ . . .. . .. .. :~
Optimjzingthe Datapath .r - ;'.,i •'.
!_·
_91APTER 4:,·'
Stand~rfSirigle~Purpose Processors: Periph~rals 83
4. I Introduction · · ·. · ··
Optimii:jpg tge FSM 'Y:' ·· 83
42 Timers, C::ou~ , and Watchdog 'I;'imers 84
2.7 -Suttimary
Timers and
2.8 'References and Further Reading•, . 84
87
. ·~TE:;~t~i]i~iieral~;~~bii;f:~i~~:;;~s:>~oft:~~~,-;~:, .._,,h;i; ,.· 88
3.1 Introduction · · ·' · ., · · · ·· . . . .. 89 ,
3. 2 ·c Architecture .. ·-' i - 1 90
D ath .. Pulse Width Modulators· 92
i1t;ol Ulli(f/ '.· t~n~·: ,. ,:"~·- i-· 92
~ ; ; ; Controlling a D~-~otorUsinga PWM~- , , · ,:·
Memory 4 .5 LCDControllers .. .
94
·. 3.3 · 0 ration . 95
Overview
Inst ction Exe.cution 95
Example: LCD,lnitializafiori'' ;;' 97
~ipeliriirig - · · ·
4 .6 Keypad Controllers . 97
.xiv.
I
~nterits r.
!.J ,_--~ - - ~ - - - - - - - ~ . - - - , - - ' - - ~ ~ - _ _ _ . : . - ~ ~ ~
Conteni!: .
Example: ·fil4p+64 ~d. ~?C~~B."R.::1\W~PM D~v1ces .· 120 li. .•..· Network-Oriented Arbitration Methods' · 162 .
- ~'.~
5·t~~z~:m=~l=~~ii Mti1:~li~!s~ga~n- ~F.:u~pt~tab~le ==_~~~!:~;~~~
\
SA
Example: TC55V~}25FF~l00 Memory Device
Composing Me~ory · · ,;;, :::•\; , · !;~ :~·~:--.~ 6-~
-fx=a1~:~~ 5 1~·01
· 55 Me_m ory llierarchy and Cache· 125 ~ 6.8 · Advanced ConimunicationPrinciples 166
·, Cc1che MapPing:Techniqu.es .. :,_; ,·. :; ., , , 126 l .· · Parallel Communication . 166
Cach¢.:Replacement Policy ·. '' , 128 ·,:_;· ·-:;_.<;. .· Serial Commi,mication 166
Cache:Write Techniques · .-,·> 128, ; ·•·' Wireless Communication 167
Cliche lmpact on System PerfornHW.~ :,fo:i ,: · 128 .i Layering 16~
S.6 •·.· J\dvanc~d RAM . · ;.,~;nc,n,\· '' · · 130 t,;
ill
,: :, Error Detection and Correction I 68
www.compsciz.blogspot.in
-~<;ontents
.·
~~--;_;_~_;.,....,......_...,.......,....,..._...,......~__,...,......,... --:---:-.,.._,.,..,..._,,._ l
1
~
186. , 235
. Nonfunctional Requireroents
8.14 Implementation . . .. . . 236
Inf~rmal Functional Specification · 187 · _Creating ·· a.nd Terminating Proce.sses 236
· Refined Functional Specifica!ion ·· 187 ' Suspending and Resu.min_·_ g Processes
. . ·.,
'111·11. 238 ·.
7.4 Design 194 ;_.
. Join_ing a: Process · ··
9
11
Implementation 1: Microcontroller Alone 195 : 239
1,!
· Scheduling Processes . 239
Implementatjon 2: Microcontroller and CCDP:P . . 195 i . :/. 8.15 Dataflow Model
. .
IiI - .. .- - --·-:--: Implementation 3 :Micro.conttoller ancJ GCDPP/F1xed".'Pomt DCT 200 ; -·~, c · 8.16_ Real-Time Systems
241
Implementation 4: MicrocontmllerandCCpPP!DCT 403 ;i 242
205 Windows CE 242
1·. . 7.5 Summary :· ,.· · . \:- . .
i ·_·__ . :~::.x~ . .7. 6 References and Further Reading 2osi QNX 243
205. !
! . . ..
I 8.17 Summary 241
i r 207 i. ' , , 8':'18 · 'I{efererices and FurtherReadirig 244
~~TEi~~ cis~;~te' Madhine and ConcurrentPmcess MCldels ..
; '°~ . 1 9 Exercises i44
8 .1 Introduction · · ·.. . · . . , ·· .· · 207 i · ·,: ~ .:,. CRAPTER 9: Control Systems
8.2 · Models ~s. Languages;Text vs.,Graphics 2°..
9
:209 ;·:.:. '.'\~ 9.1 · Introduction . · ··: ,. · / /
245
·245
· ¥odeis vs: L·a_nguage~ , · . . .
. t'e'>ctual Languages vi{ Graphical Languages 21o 1 u2::· 92CNe~~z;i~~op and ,~iosed-1:°oP,1 ;o~!;.srst~ts:·,·.· · . 246 .·
246
.\
www.compsciz.blogspot.in
lF.
. -S-f:in-'-,t,!..:..T-'--i- •.:..:.
__ .- . _:.___ _ _ _ _---,---------':-::-:--:--::-:---:-------:----,----,---'-----
i
1
... .. ,·
·:., :.: ..,. ·
CHAPTER 1: Introduction
fl E~bedded sfsfariis
6veryiew. , ...·..·. _. .· ...•....
1.2 Design Challenge -Optimizing Design Metrics
l.J . ProcessorTechnology
1. 4 -• 1 IC Technology · ·
LS D~igtt Techrio16gy ··
f.6 Tradeoffs ··,.· . ·. ·
www.compsciz.blogspot.in
rr-
., ----
II -
Automatic transmission ·On-board navigation CCD
' ·
.
· Avionic systems · Pagers . . .
Battery chargers. Photocopiers .
Cimitorders · Point-of-sale systems
.. Cell
Cell phones
phone base stations Portab
S. Cordless phones
Cruise -control
Printerle
s video games
Satellite phones
Scanners
(J · .
· , .
_· . ·
. . · . . · ·
Curbside check-in systems Smart ovensldishwashens
·
Digital cameras
Disk drives Speech recogJl
Stereo systems ·
iz.ers · I«,l
.·,~· l ·
DMA controller _, ·.
Electronic card readers Teleconferencing systl
Electronic instruments Televisions ·. ·
Electronic toys/games Temperature controlle
Factory control · .
Theft tracking systems
Fax machines TV set-top ·boxes Memory controller
Fingerprmt identifiers VCR' s, DVD players
Ho,ne security systems Video game consoles
Life-support systems Video phones . ')
Medical testing systems. Washers and dryers Figure 1.2: An embedded system .,;..,,;:,ple--,- a digital_
camera.
2
Erti~ ed System Design
·"·- ·--- ---- ··".www.compsciz.blogspot.in
~~ --- 3
----- - ···-·- ·. --- --·· ·· --- --- --- --- --~ ~~ C--
"-= -== ==- ::iJh:;;:::: ---- -:--
Chapter 1: Introduction 1.2: Design Challenge - Optlmklng Design Metrlc:a
For example, consider the digital camera chip shown in Figure 1.2. The charge-coupled
device (CCD) contains an array of light-sensitive photocells that capture an image. The A2D
and D2A circuits coilvert analog images to digital and digital to analog, respectively. The
CCD preprocessor provides commands to the CCD to read the image. The JPEG codec
compresses and decompresses an image using the JPEG1 compression standard, enabling Size
f.
compact storage of images in the limited memory of the camera. The Pixel coprocessor aids
in rapidly displaying images. The Memory controller controls access to a memory chip also
fouild in the camera, while the DMA controller enables direct memory access by other devices
while the microcontroller is performing other functions. The UART enables communication
with a PC's serial port for uploading video frames, while the ISA bus interface enables a
faster connection with a PC's ISA bus. The LCD control and Display control circuits control Figure 1.3: Design metric competition- improving one may worsen others.
the · display of images on the camera's liquid-crystal display device. The ·
Multiplier/Accumulator circuit performs a particular frequently executed multiply/accumulate / NRE cost (nonrecurring engineering cost): The one-time monetary cost of designing
computation faster than the microcontroller could. At the heart of the system is t11e 0
the system. Once the system is designed, any number of units can be manufactured
Microcontroller, which is a programmable processor that controls the activities of all t11e ~ithout incurring any additional design cost; hence the term nonrecurring.
other circuits. We can: think of each device as a processor.designed for a particular task, while /"' Unit tost: -'.{he monetary cost of manufacturing each copy .of the system, excludinr,
the microcontroller is a more general processor designed for general tasks. yREcost.
This example illustrates some of the embedded system characteristics described earlier.. / . Si.it:'' The physical space required by the system, often measured in bytes for
First, it performs a single function repeatedly. The system always acts as a digital camera, · / / /oftware, and gates or transistors for hardware.
wherein it captures, compresses, and stores frames, decompresses and displays frames, and . / ,.. /
7
PerfortJUince: The execution time of the system.
uploads frames. Second, it is tightly constrained. The system must be low cost since ; , / Poy,er. The amount of power consumed by the system, which may determine the
consumers must be able to afford such a camera. It must be small so that it. fiis within a lifetime of a battery, or the cooling requirements of the IC, since more power means
standard-sized camera. It must be fast so that it can process numerous images in milliseconds. morehea1/
It must consume little power so that the camera's battery wiil last a long time. However, tllis / Flexibility: The ability to change the functionalit; of the system Y.ithout incurring
particular system does not possess a high degree of the characteristic of being reactive and • . ,ieavy NRE cost. Software is typically considered very flexible.
real time, as it responds only to the pressing of buttons by a user, which, even in the case of an ,./ ~ime-to-prototype: Th!~~11~e~ t()J?lln<!.!..wor~i.!!K:Y~rsi_on o_[l!!_e_~ys!~, which
avid photographer, is still quite slow with respect to processor speeds. · . may ~gger or more expensive than the finiil system 1mplementallon, but 1t can be
used to verify the system's usefulness and correctness and to reline the system ·s
0
ymctionality. .
1.2 Design Challenge - Optimizing Design Metrics ~ , Time-tg-'!}{lrket: The"-tim~..n,gy'ged_JQ_dex_rj9~~~_tem_l~l.ffie _point that it can be
/ re)~as~ __l!Jl<:I . SOid t() customers. The ·mairi: ~Q.ntriQ,Ut<!!:,S,_ ~ design time,
The embedded-system designer must of .course construct an implementation tl1at fulfills .. manufacturing time, ancftestfogume. - . . -· .
desired functionality, but a difficult challenge is to construct an implementation that · • Maintainability: The ability to modify the system after its initial release, especially
simultaneously optimizes numerous design metri¥. by designers who did not originally design the system. . .
~Correctness: Our confidence that we have implemented the system's functionality
ComJrion Design Metrics/ _/ ·· correctly. We can check the functionality throughout the process of designing the
1:p/our · purposes, an implementation consists either of a microprocessorr with an ~system, and we can insert test circuitry to check that·manufacturing was correct
accompanying .program, a connection of digital gates, or some combination thereof. A design . ~ SafeQ>_:_}'he probability t~~t the system wiH not ca1:1.se harm.
/
\
. .
. ' . r
1 JPEG is short for Joint Photographic Experts Group. "Joint" refers to the group' s :
-·
metric is a measurable teature of a system's implementation. Commonly used metrics include: '
. .
Metrics typically compete with one another: lmprov~ one often leads to worsening of
another. For example; if we reduce an imple enfation' s size, the implementation· s
performance may suffer. Some observers have mpared this phenomenon to a wheel with
status as a committee working on both ISO and ITU-T standards. Their best-known standard numerous pins, as illustrated in Figure 1.3. If, . u push one pin in, such as size, then the other
is for still-image compression. '·
on-time mark~t entry i~ the area ~fthe triangle labeled On-time, and the revenue for a delayed
pins pop out. To best meet this optimization challenge, the designer must be comfortable with ] ~n~ produc_t 1s the area pf the triangle labeled Delayed.'The ~~e loss for a delayed entr
a varietv of hardware and software implementation technologies, and must be able to migrate :
from o~e teclmology to another, in order to find the best implementation for a given ::
J!LIUSt..the_difference.of
~7 ·"----·-··----------.-··· these two. tr·tang Ie,s' lit~~--
· __tVs~denve
Le "'"" - an ~lion for· percenta ey
_ revenue loss, which. eci,uals ((?n-t1me :- pelayed) I On~time) * I ooyor-simplicity, we;I ···
application and constraints. Thus, a designer cannot simply be a hardware expert or a software :\ ~ssume the ~arke! nse angl~ is_ 45 degrees, meanin_~ !.11e_height of the triangle is W, and we
expert. as is commonly the case today; the design~r must have expertise in both areas. · ~~e 3;~:~all-~eJlerS1~e ~e denva~on of1,the sa~e equation f~r any angle. ~ e a .C>fth<: On-
t tr t ~ C~£!1~_,a_~2 ,*__tg_ ~e-~--~igbt, is. thu& ½ ~2W * W, or W 2 • The area ;ofthe
The Time-to-Market.Design Metric ~ n~ le 1s-½. (.W'-
. D + W) *. (W - D). After a\gebr.a1c · s1mphficat1on,
· · · we obtain the
Most of these metrics are heavily constrained in an embedded system. TI1e time-to-market .' 1011owi~g equation for percentage revenue loss:
constraint has become especially demanding in recent years. Introducing an embedded system ,
to the marketplace early can mak~ a big difference in the system's profitability, since niarket '
d. . percentage revenue loss ={D(3W,~D) / 2W2) * IOO% !.-'
J- 1<ki
2- J. yJvifW'
0
windows for products are becoming quite short, with such windows often measured in · <:onsider a prod_uct ~hose lifetime js-5 ~:. so W = 26. Accor~ing~: the prec~ng
months. For example,[Figure l.4(a) shows a sample market window during which time a · equau _ el~y of Just D = 4 w r~§Ults. m areve11ue loss of 22%, and a delay of D = 1O
product_ would have hi~l sales. Missing this window, which means that the product begins w . ,results m a loss of'5~. S?mestudies claim that reaching market late has a larger
being so further to the right on the time scale, can mean significant loss in sales. In some · n~gaove effect on revenu 1han g¢4elopmen.t cost overruns or even a product price that is too
ca . each day that a product is delayed from introduction to the market can translate to a high. ' / .
e-million-dollar loss. The average tJme-to-market constraint has been· reported as having . o(2iv0~
.?I~~.*'(O·J·-;\ &_--0Y!J
sluunk to only 8 monthsT> , The NRE and Unit Cost Design Metrics ~· o-
Adding to the difficulty of meeting the time-to-market constraint is the fact that As anoth~ exercise,_ let's consider _NRE cost and unit cost in more detail. Suppose three
embedded system complexities)tre growing due to increasing IC capacities, as we will see technolog1~s are ava1lable for use m a particular product. Assume that implementing the
later in this chapter. Such rapid growth in .IC c,apacity translates into pressure on designers to product usmg technology A would result in an NRE cost of $2,000 and unit cost of $100, that
add more functionality to a system. Thus. dysigners today are being asked to do more in less technology B would have an NRE cost of $30;ooo and unit cost of $30, and that technology c
A time. //
t's investi.gate the loss.· o~ re.·ve.ntfe that can occur due .to delay~ en. ~ of a product i~ :
market. We'ILuse a sunphfi~odel of revenue that 1s shov.:n m Figure 1.4(b). This;
assumes the peak of !he market occurs at the halfway point, denoted as W, ·of the
. product life, and that the peak is the same even for a delayed el).try . The rdve!]ue._ for an
~oul~ have an NRE cost of $100,000 and unit cost of $2. Ignoring all other design metrics,
hke t1me-to-m:irket, the ~st technology_ choice will depend on the number of units we plan to
produce. ~e illustrate this concept with the plot of Figure l.5(a). For each of the three·
technologies, we plot total cost versus the number of units produced, where: .
------------'--~------'----------:(' - = - - - - - - - - - - - - ~ - - - - --__:______7
Embedded System Design~:; Emb.edded System Design
6
www.compsciz.blogspot.in
Chapter 1:.Introduction
total cost= NRE cost + unit cost * # of units In embedd~ systems, perfonnance at a very detailed _level is. also often Qf concern. in
We see from the plot that, of the three technologies, technology A yields the lowest total particular, .two signal changes may have to be generated or measured within some number of
cost for low volumes, namely for volumes between l and 400. Technology B yields the nanoseconds,·
lowest total cost for volwnes between 400 and 2500. Technology C yields the lowest cost for · - Speedup is a com'!lon method of comparing the performance of two systems. The
volumes above 2500. speed\lp of system A over system 13 is determined simply as:
Figure l.S(b) illustrates how larger volumes allow us to amortize NRE costs such that speedup of A over B = performance of A / performance of B.
lower per-product costs result. The figure plo~ per-product cost versus volwne, where~
. Performance could be measured either as latency .or as throughput, depending on what is
per-product cost = total cost I # of' units = NRE cost/ # of units + unit cost of m~erest. Suppose the speedup of camera .A over camera B is 2. Then we· also can say that A
For example, for technology C and a volume of 200,000, the contribution to the · 1s 2 times faster than B and B is 2 times slower than A.
,...,,,,-·
per-product cost due to NRE cost is $100,000 / 200,000, or $0.50. So the per-product cost -!\
would be $0.50 + $2 = $2.50. The larger the volume, the lower the per-product cost, since the
NRE cost can be distributedover more products. The per-product cost for each technology 1.3 Processor Technology · -·1,.
approaches that technology's unit cost for very large volumes. So for very large volumes,
We can define technology as a manner of accomplishing a task, especially using technical
nwnbering in the hundreds of thousands, we can approach a per-product cost of just $2 -
__,, processes,_ methods, or knowledge. This book takes the perspective that three types of
quite a bit less than the per-product cost of over $100 for small vq~s.
technologies are central to embedded system design: processor technologies, IC technologies,
Clearly, one must consider the revenue impact of both · e-to-market and per-product
and design technologies. We describe all three briefly in this chapter and provide further
cost, as well as all the other relevant design metrics whe .. al"uating different technologies.
' '
.7 4 details in subsequent chapters.
. Processor technology relates to the architecture of the computation engine used to
The Performance Design Metric .:._.,/ ui:iplement a system's desired functionality. Altl1ough the term processor is usually associated
Performance of a system is a measure of how long the system takes to execute our desired with programmable software processors, we can think of many other, nonprogrammable
tasks. Performance is perhaps the most widely used design metric in marketing an embedded digital systems as being processors also. Each such processor differs in its speciali1.atio~
system, and also one of the most abused. Many metrics are commonly used in reporting towards a particular function (e.g., image compression), thus manifesting design metrics
system performance, such as clock frequency or instructions per second. However, what we ifferent tl1an other processors. We illustrate this concept graphically in Figure 1.6. The
really care about is how long the system takes to execute our application. For example, in pplication requires a specific embedded functionality, symbolized as a cross, such as the
terms of performance, we care about how long a digital camera takes to process an image. r summing of the items in an i>.rray, as shown in Figure I .6(a). Several types of processors can
The camera's clock frequency or instructj_ons per second are not the key issues - one camera implement this functionality, each of which we now describe. We often use a collection of
may actually process images faster but have a lower clock frequency than ariother camera. such processors to optimize a system's design metrics, as in our digital camera example.
With that said, there are several measures of performance. -For simplicity, suppose we
a
have single task that will be repeated over and over, such as processing ai1 image iii digital a , 'General-Purpose Processors - Software
camera. Jhe-twomain measures of performance are: __ ........ ·
The designer of a general-purpose processor, or microprocessor, builds a programmable
• ·· Latency, or response time: The time between the start of the task's execution and the
device that is suitable for a variety of applications to maximize the number of devices sold.
end. For example, processing an image may take 0.25 second.
One feature of such a processor is a program memory - the designer of such a processor
• · Throughput: The number of tasks that can be processed per unit time. For example, a
does not know what program will run on the processor, so the program cannot be built into
camera may be able to process 4 images per second.
the digital circuit. Another feature is a general datapatl1 - the datapath must be general
However, note that throughput is not always just the number of tasks times latency. A
enough to handle a variety of computations, so such a datapath typically has a large register
system may be able to do better than this by using parallelism, either by starting one task
before finishing the next one or by processing each task concurrently. A digital ca..,iera, for t file and one or more general-purpose aritlune ·
designer, however, need not be conce
· units (ALUs). An embedded system
about the design of a general-purpose processor.
example, might be able to capture and compress the next image, while still storing the :;
previous image to memory. Thus, our camera may have a ·latency of 0.25 second but a t n embedded system designer si
processor' s memory to ca
y uses a general-purpose processor, by programming the
ut the required functionali ty. Many people refer to this part of
throughput <:>f 8 images per second. l•,
t: an implementation as software" portion. ·
f.~
------------'-------------------------
.8 Embedded System Oesign
· . -·-- - ·~·-- · · · -- ~
www.compsciz.blogspot.in
-~ ~ -; -~.:...:::.....cvo"c ·· , - _, ,-~ __,;-1 /½·-· ~ - --
l_ Embedded System Design
9
Chapter 1: Introduction 1.3: Pro~ssor Technology
DO (b) (c)
0 (d) Program
. memory/
Data
memory memory
Datil
memory
/
.._,/ . .
/'
.._____,
/
Data
.,,..rilemory
As$p1Tlb(y Assembly.· ··
Figure 1.6: Processors vary in their customization for the problem at hand: (a) desired functionality, (b) general-
purpose processor, (c) application-specific processor, (d) single-purpose processor. e6de for: code for:
,.../
total =iO ~ a-total= 0
/ 4 . g a general-purpose processor in an
embedded system may result in several design fori =I lo. I
fori-=l to
metric benefits. Time-to-market and NRE costs are low because the designe_r must only write
(a) (b)
a program but not do any digital design. Fle~bility is high because changing functionality (c)
requires changing only the program. Unit cost may be low in small quantities compared with Figure. 1.7: Implementing dc.si(cd functionality on
different processor types: (a) general-purpose, (b)
application-specific, (c) single-purpose.
designing our own processor, since the general-pwpose processor manufacturer sells large
quantities to other customers and hence distributes the· NRE cost over many units.
Performance may be fast for computation-intensive applications, if using a fast processor, due designer may create a single-purpose processor by· designing a custom d,·e,o mtal · ·t
d' . .• . ClfCUI , as
to advanced architecture features and leading-edge IC technology. _1scussed m later chapters. Alternatively, the designer may purchase a predesigned
However, there are also some design-metric drawbacks. Unit cost may be relatively high ~mgle-p~se prn~ssor. Many people refer to this part of the implementation simply as the
for large quantities, since in large quantities we could design our own processor and amortize hardware portion. although even software requires a hardware processor on which to run
our NRE costs srich that our unit cost is lower. Performance may be slow for certain Other common tenns include coprocessor, accelerator, and peripheral. ·
applications. Size and power may be large due to unnecessary processor hardware. Usmg a smgle-purpose processor in an ~mbe<J.ied system results in several design-metric
For example, we can use a general-purpose processor to carry out our array-sununing ;; benefits and drawbacks, which are ~ssentially the inverse of those for general-purpose
functionality from the earlier example. Figure l.6{b) illustrates that a general-purpose r processors. Perf~nnanc~ may be fast, SIZe and power may be small, and unit cost may lie low
processor covers the desired functionality but not necessarily efficiently. Figure l.7(a) shows tr for large quanuties, w~le design time and NRE cos_ts may be high, flexibility low, unit cost
a simple architecture of a general-purpose processor implementing the array-sununing t_) high for s_ma~l· ~titles, and performance may not match general-purpose processors for
functionality. The functionality is. stored in a program memory. The controller fetches the [ some apphcat1o~SJ ..
current instruction, as indicated by the program counter (PC), into the instruction register :· For example, Figure l.6(d) ili~strates the use of a single~purpose processor in our
(IR). It then configures -the datapath for this instruction and executes the instruction. It then embe~ded . system example, representing an exact fit of the desired funciionality noth·
mo thin I F" · , mg
determines the next instruction address, sets the PC to this address, and fetches again. re, no g ess. tgure l. 7( c) 1Hu~trates the architecture of such a single-purpose processor
:or _the example. The data_p ath contams only the essential components for this program: two
Single~P.urpose Processors-·. Hardware egisters ,and . adder.
. one . Smee
. . processor only executes this oneprogram, .~,e
the d · the
.. h arwrre
.program s mstruc11ons d1rectly mto the control logic and use a slate register to step through.
A singJ/~purpose processor is a digital circuit designed to execute exactly one program. For those mstrucllons, so no program memory is necessary. · ·
:2.
.e)illllple, consider the digital camera example of Figiire 1 All of the components other than
the microcontroller are single-purpose processors: The JPEG codec, for example, executes a
single program that compresses and decompresses video frames. An embedded system
www.compsciz.blogspot.in
Chapter 1: Introduction
1.4: IC Technology
l_
13
www.compsciz.blogspot.in
· - - - -----'···· -·-- ·--·-' -~~~~ ~ - ~~0 .c.,;.,..;.__ · . - ; ~_.....¼.
Chapter 1: Introduction
1.4: IC Technology
10,000
·····~ ·········· ····
l ,000
Q,
:.au JOO
IC package JC
g_.;- IO
"'o --=
.. 0
-~] I
Figure 1.8: !Cs consist ofseveral layers. Shown is a simplified C°l'.f0S transistor; an IC may possess millions ofthese, ;. !;=3
connected above by many layers of metal (not shown). i• u 0. 1
.QC)
r: 0
...l
AND-OR-INVERT_combination, the mask portions are predesigned, usually by hand. Thus, f 0.01
the remaining task is to arrange these portions into complete masks for the gate level, and then [: 0.001
to connect the cells. ASICs are by far the most popular IC technology, as they provide for '
good performance and size, with much less NRE cost than full-custom I Cs. However, ASICs
I 11 11 1111
. still require weeks or even months to manufacture. ·
Figure 1.9: IC c~pacity exponential increase, following "Moore's Law." Source: The International T ho I
PLO ,,,
Roadmap for s,m,conductors. ! ec O ogy
In a prograirurul]>le logic device (PLD) technology, all layers already exist, so we can
purchase the IC before finishing our design. The laye~ement a programmable This trend, illuSuated in Figur~ 1.9, was actuaily predicted way back in 1965 by Intel
circuit, w re programming has a lower-level meaning than a software program. The co-fou nder Gord0n Moore. He predicted that semiconductor transistor density would double
pro · g that takes place may consist of creating or destroying connections ~tween eve~ 18 to 24 months. The trend is therefore known as Moore's, Law. Moore recently
wi that connect gates, either by blowing a fuse, or setting a bit in a programma)m: switch. pr~icted about ~other decade before such growth slows down. TI\e trend is mainly caused
mall devices called programmers, connected to a desktop computer, typically perform such b~ improvements m IC manufactunng that result in smaller parts, such as transistor parts and
programming. We can
divide PLDs into two types, simple and complex. One type of simple i wues, on th~ surface_ of the IC. The minimum part size, commonly known as feature size, for
PLO is a programmable logic array (PLA), which consists of a programmable array of AND ,· a CMOS IC m 2002 1s about 130 nanometers · ·
gates and a programmable array of OR gates. Another type is a programmable array logic . Figure_ 1.9 shows leading-edge chip ap~r<iximate capacity per year from 1981 to 2010,
(PAL), hjch uses just one programmable array to reduce the number of expensive usm~ predicted d~ta _for years 2000-20 IO. Note that chip capacity, shown in millions of
pro ble components. One type of complex PLO, growing very rapidly in popularity r "transi5tors. per chip, IS plotted on a logariUunic scale. People often underestimate and are
lI,,, er the past decade, is the field programmable gate array (FPGA). FPGAs offer more general /; so~ewhat amazed by the actual grow_th of something that doubles over short time periods, in
connectivity ng blocks of logic, rather than just arrays of logic as with PLAs and P ALs, 1 th1 s case 18 ~onth,s. For exm.nple, tlus underestimation in part explains the popularity of so-
and are sable to implement far more complex . esigns. PLOs offer very low NRE cost and ~ called pyranud schemes. It is the ·key to the popular trick question of asking someone to
'ristant IC availability. However, th &e typi~~gger than ASICs, -may have i' choose_betwee~ a salary o_f $1,000/day for a year, or a penny on day one, 2 pennies 011 day
gh_ unit cost, may c~nsume more power d may b e r r (especially FPG~)- They still f:: tw~, witb contmu oubJmg each day for a year. While many people would choose the first
pr ctevreasonablenormance, tho so they are espeCially well-swted to rapid I.; option, th~ sec a_ option resu_1ts in m~re money than exists in the world. Many people are
ototypmg. also surpn to discover that Just 20 generations ago, meaning a few hundred years .we find
~ that we each have one million ancestors. . . ,
Tr: nds !· . Fi~e I.IO ~hows that in 1981, a leading-edge chip could hold about 10,000 transistors,
h uld be bed { which is roughly the complexity of an 8-bit ·microprocessor. :i_n 2002, a leading-edge chip can ,
es o aware of what is by far the most important trend in em . ded systems, a trend r hold a~ut. 1_ 50,000,000_ transistors, the equivalent of 15,000 8.-bit micrnnrnri>ffnrsf ~or f
related. to ICs: IC transistor capacity has doubled roughly every 18 months for the past '
b
f -r--
companson, 1 automobile fuel efficiency had improved at this rate since 198 I cars in 2002
f
Several decaAes. !'·.;
- - ·-·--'---~~==~~''" 1~-·--·
14
www.compsciz.blogspot.in J /'
· · •· - , ··-·_..,.··?:,;;,· 'rlb:anLA;,;#AJt=t<f.::,;-;-=- "'tN ,·. ·
r
f:1
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - t;
. Chapter 1: Introduction f_
_ . ; ~ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - r·; 1.5: Design Technology ·
f
i
I
f ------,---,-----\--h---~~:::........-
-,------~;:.._----'-----arllWPl~-~ .
~~aa~Ji
Chapter 1: Introduction
1.6: Trade-offs
Libraries/IP
!Libraries involve reuse of preexisting implementations. Using libraries of existing ·. ,----------------...:.·~-'-:-'--.- 100,ooY ,
\r6plementations can improve productivity if the time it takes to fi~d; acquire, integrate, and • g
test a library item is less than that of designing L'le item oneself. ~ . 10,000 ..c
A logic-level' library may consist of layouts for gates and cells. An ·R:_r.-level library r~ay E
0
1,000
i
consist oflayouts for RT components. like registers, multiplexors, decbders, and functional
units. A behavioral-level library may consist of commonly used componenls, such as 100
·-·.:::,c·:,. i:=-"...t
tI , compression .components, bus inteifaces. display controllers. and even general-purpose
10
g ,!:!}
"O ~
O · "O
processors. The advent _of_~:ystem-level integration has caµ~4 !!..&I:Ce!!.t_c.hange in ~s level of ~ it ~
,~-b' Rather than ·these c01nponeri:ts being ICs, they now must also be availabl~ in a form 0
ti '-.
·.;
that e can implement on just one portion of an IC. Such components are ~ailed cores. This C:
0.1
ch ge from behavioral-level libraries of I~s to libraries of cores has prompt~d the use of the . ~
t m1 · ellectual property (IP), to emphasize the fact that cores exist m an mtellectual form. 0.01
tl must be protected from copying. Finally, a system-level library might consist of complete 00
0,
;;:: 0 M
0
.,.,
0
r- 0,
0, 0 0
0 0 0 0 0
syste~s solving particulru- p~oblems, such as an inter~onnectiori ·of processors with N
accompanying operating $)'Stems and programs to implement an interface to the Internet over
"' "' N N
an Ethernet network. Figu~e 1.12: Design productivity exponential increase. Source: The. International Technology Roadmap for
Semiconductors. .· . ·
Test/Verification
· Languages focus. on capturing desired functionality with minimum designer effort. For
Test/verificahon invol~e,5:J ~ t fun~tionality is co~ect.. Such assurance can prev~nt f example, the. sequential programming· language of C is giving way to the object.oriented
tnne-cqnsummg debuggmg at low abstracllon levels and Iteratmg back to lugh abstraction i language of C++, which in tum has given some ground to Java. As another example,
lev . -~ state-machine languages pennit direct capture of functionality as a set of states and
Simulation is the most common method of testing for C?l!.<,.C.t functionality, although ·~ transitions, which can then be translated to other languages like C.
more formal ~-erification techniques are growing 1n popuiaiiiy'..ATthe logic level, gate-level'; Frameworks provide a software environment for the application of numerous tools
simulators provide output signal timing waveforms given input signal waveforms. Likewise, ; throughout the design process and management of versions of implementations. For example:
general-purpose processor' simulators execute machine code. At the RT-level, hardware .'. a framework might generate the UNIX directories needed for various simulators and svnthesis
description language (HDL) simulators execute RT-level descriptions and provide output 1 !<><>ls, supporting application of those tools through menu selections in a single graphical user
aveforms given input waveforms. At the behaviQral level, HDL simulators simulate · interface. -· ·
equential programs, and cosimulators connect HDL and general-purpose processor
/ :
mutators to enable hardware/software coverification. At the syste~ level, a model simulator . ; Trends
mutates the initial system specification using an abstract computation model, mdependent of . :
any processor technology, to verify correctness and completeness of the specification. Model ' Th~ combination of cornpilati~n/S}'Ilthesis, libraries/IP, test/verification, standards, languages,
checkers can also verify certain properties of the specification, such as ensuring that certain and frameworks has imp(OVed designer productivity over the past·several decades, as shown
simultaneous conditions·ne"er occur or that tl1e system does not deadlock. in Figure I. 12. Productivity is measured as the number of transistors that one designer can
produce _in one month. As the figure shows, the gro\\oth has been impressive. A designer in
More Productivity lmprovers 1981 could produce only about 100 transistors pen:nonth, whereas in 2002 a designer should
be able to produce about 5,000 transistors per month. ·
There are numerous ~dditional approaches to improving designer productivity. Standards.
focus on developing well-defined methods for specification, synthesis, and libraries. Such
standards can reduce the problems that arise when a designer uses multiple tools_,or retrieves 1.6
or provides design information from or to other designers. Common standards include Trade-offs
language standards, synthesis standards, and library standards. Perhaps the key embedded system design . challenge is the simultaneous optimization of
t--
, competing d~ign metrics. To address this challenge, the designer trades off among the
18
~
. . .. - ···- ~ ~ - ... ·· - ·· ... . Em,,_ s,..,m O~ga s,..,m o~..,
www.compsciz.blogspot.in
-~ .' Y d&'.~ ., .,
:'I
-·-~ :.:.. ::::: === ---- ---- -- §
~pter 1: Introduction
;
· 1.6: Trade-0ffs
General- Single-
General; ·purpose ASIP purpose
Customized,
providing improved: processor processor
providing improved:
Flexibility
Maintainability ¢=:J ,---1\ Power cHiciency
L-y Performance
NRE cost Size
Time- to-prototype
Cost (high volume)
Time-to-market
Cost (lov.' volume)
PLO Semicustom Full-custom
Fi gure 1.14, The independence of processor.and IC technologies: Any processor technology can be mapped to any IC
technology.
of abstraction, as illustrated in Figure I. 13. Thus, the starting point for either hardware or
software is sequential programs, enhancing the view that system functionality cau be
implemented in (:lardware, software, or some combination thereof. leading to the following
important point:
The choice of hardware versus software for a particular function is simply a
trade-off among various design metrics, like performance, power, size, NRE
l . cos/, and especial(v flexibility; there is no fundamental difference between
Figur~ t .l 3: The co-design ladder: recent inaturation of synthesis ena!>les a unified view of hardware and software. J what hardware or software can implement.
• f!ardwarel.1oftware codesign is the field that emphasizes a wtified view of hardware and
. tages of.the vario~ available processor techno~o~es ~ IC ( software, and develops synthesis tools and simulators that enable the co-developmen t of
advantages and disadvan
technologies. To optimize a system, the designer must therefore be familiar wtth and I systems using both .h ardware and software.
comfortable with the various technologies - the designer must be a "renaissance engineer," · In general, we can view .· the basic design trade-off as general · versus customized
in the words of some. In the past and to a large extent in the present, however, ·most designers · implementatio n, with respect to either processor technology or IC technology, as illustrated in
had expetlise with either general-purpose processors or with single-purpose processors but not · Figure I. 14. The more general. programmable technologies on the lefl of the figure provide
. both - they were either software designers or hardware designers. Because of this separation grea(er flexibility (a design can be reprogrammed relatively easily), reduced NRE cost
of design expertise, systems .had to be separated into the software and hardware subsystems (designing using those technologies is generally cheaper). faster time-to-prototy pe and
very early in the desig:i process, separately designed, and then integrated near the end.of the. time-to-marke t (since designing takes less time), and lower cost in low volumes (since the IC
process. However, such early and pennanent separation dearly dOt:Sn't allow for the best manufacturer distributes its IC NRE cost over large quantities of !Cs). On the other hand,
optimization of design metrics. Instead, being able to move functions between hardware and more customized technologies provide for better power efficiency, faster perfonnance.
software, at any stage of the design process, provides for better optimiz.ation. ...· . reduced size. and lower cost in high volumes. ·
TI1e relatively recent maturation of RT and behavioral synthesis tools has enabled a, Recall that each of the three processor technologies can be implemented in any of 1he
unified view of the design process for hardware and software. In the past, the design processes three IC technologies. For example, a general-purpose processor can be implemented un a
were radically different - software designers wrote sequential programs, while hardware PLO. semicustorri, or full-custom IC. In fact , a company marketing a prod11ct, such as a
designers connected components. But today, synthesis tools have changed the hardware set-top box or even a general-purpose processor, might first market a semicustom
designer's task essentially into one of writing sequential pro~ . ajbeit_..~th some , implementatio n to .reach the. market early, and then later introduce a full-custom .
knowledge 9f how the hardware will be synthesized from such programs: We ;can think ·of implementatior:i. They might also first map the processor. to an older but mme reliable
abstraction levels as being the rungs ofa ladder, and compilation and synthesis as enabling us . . technology, like 0.2 micron, and then later map it to a newer teclmology, like 0.08 micron. ·
to step up.the ladderand hence enabling designers to focus their design efforts at higher ~ey~Is ; These two evoluHons of mappings to a large extent explain why a general-purpos e processor'~
....... Team
60000
~~ 50000 19
· -> i::
0
·u E 40000
::, ...... 23
'O ~
e t;,;o
0. 30000
.,!ii';;;a ./ Months until completion
I-< t:, 20000 43
10000 .Individual
oc ....,
00
"'
00 r--
00 °'
00 r--
0 °'
0 0 10 20 30 40
°' °' °' ~ ~ 0
N .
0
N
Number of designers
Flgur~ 1.15: The·growing "design prrn;lucti.vity gap."
Figure 1.16: The "mythical man-month": Adding designers can decrease individual productivity and at some point
can actually delay the project completion time.
clock speed improves :on the market over time. Likewise, a designer of an e~bedded system :·1··:.•·.·.:,
may use PLDs for prototyping a product, and even for the first few hundred m.stances of the 1
. The situation is even worse than stated before, because the discm;sion assumes that
product to speed its time-to-market, switching to ASICs for larg~r-scale productloIL designer productivity is independent of project team size, whereas in reality adding more
Furthermore we often implement multiple processors of different types on th~ same IC. designers to a project team can actually decrease productivity. Suppose 10 designers work
Figure 1.2 was 'an example of just such a situation - the, digital cam~ra mcl~ded_ a together on a project; and each produces 5,000 transistors/month, so that their combined
microcontroller plus ·numerous single-purpose processors on the same IC. A smgle_ chip with output is IO * 5,000 = 50,000 transistors/month. Would 100 designers on a project then
multiple processors is often referred to as a system-ori-a_-chip. In fact, we can even implement produce 100 * 5,000 = 500,000 transistors/mqnth? Probably not. The complexity of having
more than one IC technology on a single IC~ a portion of the IC may be custom, ai_iother 100 designers work together is far greater than having 10 designers work' together. Even
portion scmicustom, and yet another portion programrna~le logic. The n~ for designers calling a meeting of 100 designers is a fairly complex task, whereas a 10-<iesigner meeting is
comfortable with the variety of processor and IC technologies thus becomes evident. quite straightfon'vard. Furthermore, a 100-designer team would likely be decomposed into
groups; each group having a group leader that meets with other group leaders and reports back
. Design Productivity Gap · , · to his or her group, thus introducing extra layers of communication·.and hence more likelihood
cif misunderstandings and time-consuming mistakes.
While designer productivity has grown at an impressive rate _over the past decades, the ra~e _of· •
This decrease in productivity as designers are added to a project was reported by
improvement has not kept pace with chip capacity growth. F1~e I. 15. shows the p~oducti~1ty ··
Frederick Brooks in his classic 1975 book entitled The Mythical 1:{an-Month. His book
growth plot superimposed on the chip capacity gro~ plot, 1llm;~t1ng th~ growmg design
focused on writing software, but the same principle applies to designing hardware. . The
productivity gap. For example, in 1981, a leadmg-edge chi~ requue_d about 10~
decrease in productivity due to .team-size complexity.can at some point-.actually lengthen the
designer-months to design, since 100 designer:-months * 1_00 trans1stors/~es1gner-month -
time to complete a project. For example, consider a hypothetical 1,000,000 transistor project,
!0,000 transistors. However, in· 2002, a leadmg-edge chip woul~ reqmr~ about 30,00~
in which a designer working alone can produce 5,000 transistors per month, and each
designer · months; since 30,000 designer-~o~ths * 5,000 tran_s1stor~des1gner-month . -
additional designer added to the project results in a productivity decrease of 100 transistors
150 000 000 transistors. So the design productlVIty gap has resulted m '.1" increase from 100 to
per designer, due· to the added complexities of team communication and management. So a
30,000 designer-months to build a leading-edge chip'. Assuming a designer cos!s $10,000 per
designer can complete the project . in 1,000,000 / 5,000 =· 200 months,· 10 designers can
month, the cost of building a leading-edge chip has risen from, $1,0~,000 m 1~81 to ~
incredible $300,000,000 in 2002. Fe·w products can justtl'.Y su~h large _mvestnlent m a chip. produce4,100 transistors per month each; meaning IO~ 4,100 = 41,000 transistors per month
Thus, most designs do not even come ~lose to using potential chip capacity. . total. requiring 1;000;000 I 41,000 = 24 .3 months to complete the project. Figure 1.16 plots
individual designer productivity as designers are added to the project. The figure also plots
www.compsciz.blogspot.in
-------------:-_:_--------------l----------~----...;.~_______1.;:·~--:R.:,e:.:,fete=.:nc=:e:s.:a::,:n:d.:_F:u:,:rt:h:er:_:R:~::a~c!'.'.;i!'l~!f
-C-ha-_p-t-er_1_:_ln-tr_od_uc-t-io_n__
team productivity, computed simply as the number of designers multiplied by their individual : The chapter is mostly a review of the features of such proc~ors; we assume the reade
productivity. Project completion _limes for different team sizes, compute? as 1,000,000 :, already has familiarity with . programming such processors using structured language:.
transistors divided by team-transistors/month, are also shown, A 25-designer team can .; Chapter 4 covers standard smgle-purpose processors, describing a number of common
produce 25 * 2.600 = 65,000 transistors per month, requiring l ,000,000/65,000 = 15.3 months l peripherals used in embedded systems. Chapter 5 describes memories, which are components
to complete the project. However, a 26-designer team also produces 26 * 2.500_ = 65.000 ., neces~ to store data for processors. Chapter 6 describes buses, components necessary to
transistors per month. so adding a 26m designer doesn' t help. Furthermore. a 27-_designer team commurucate data among processors and memories, beginning with basic interfacing
concepts, and introducing more advanced concepts and describing common buses. Chapter 7
produces only 27 * 2.400 = 64.800 transistors per month, thus actually delaymg the proJect ._•:
provides an e_xample of using processor technology to build an embedded system, a digital
1-·;···-
:
:
completion time to I 5.4 months. Adding more designers beyond 26 only worsens the proJcct
completion time. Hence. man-months are in a sense mythical: We cannot always add camera, illustrating the trade--0ffs of several diffef\ent implementations. ·
designers to a project to decrease the project completion time. . . . . Chapter 8 introduces some advance4: _techniques for programming embedded systems.
Therefore. tlie growing gap between IC capacity and designer productlVlty m F_1gure 1.15 including state machine models, and concurrent p'rocess models. It also introduces real-time
is even worse than the figure shows. Designer productivity decreases as we add designers to a systems. Chapter 9 discusses the very common class of embedded systems known as control
project. making the gap even larger. Furthennore. at some point we sim~ly cann_ot decr~se systems, and introduces some design techniques used for such systems.
project completion time no matter how much money we can ~pend on designers, smce addmg , C1'apter 10 describes the three main IC technologies with which we can implement the
designers will decrease the project team's overall productivity. And therefore. leading-edge :, processor-based designs we learn to create in the earlier chapters. Finally, Chapter l l
chips cannot always be desi 9ned in a given time period. no matter how much money we have ,. summarizes key tools and advances in design technology and emphasizes me need for a new
to spend on designers. ·· . . . . , breed of engineers for embedded systems proficient with boili software and hardware <lesign.
Thus. a pressing need exists for new design technologies that will shnnk the design gap. !
One partial solution proposed by many people is to educate designers not Just m one subarea ij
of embedded svstems. like hardware design or software design. but instead to educate them to ij 1.8 References and _Further Reading
be comfortabl~ with both hardware and software design. _TI1is book is intended to contribute to U
this solution. i • Brooks Jr., F.P., The Mythical Man-Month, anniversary edition. Reading. M A: Addison-
1.6 Using the revenue model of Figure 1.4(b), derive the percentage revenue loss equation ij 1.21 Compute the annual growth rate of (a) IC capacity and (b c1es·
1.22 If Moore' s law continues to hold, predict the a ' ro~ igner producttvi~.
. ..
for any rise angle, rather than just for 45 degrees (Hint: you should get the same I{
equation). _ _ ; leading edge re in (a) 2030, (b) 20so. PP te number of transistors per-
1.7 Using the revenue model of Figure 1.4(b), compute the percentage revenue loss if D = 5 : 1.23 Explain why single-pmpose processors (hardware) and eneral-
and W = 10. If the company whose product entered the market on time earned a total :• essenuaU~:he sain.e, and then describe how they differ ingterms o~~ pr~rs are
revenue of $25 ·million, how much revenue did the company that entered the market 5 ['. 1.24 Whal 1s a remnssance engineer," and why is it so important in t h e ~ metrics.
months late lose? i 1.25 What is the design gap? nt market?
1.8 What is NRE cost? ·, l; 1.26 Compute the rate at which the design productivity ga · · ·
implication of this growing gap? P is growmg per year. What IS the
edesign of a particular 4isk drive has an NRE cost of $100,000 and a unit cost of f
1.27 Define what is meant by the "mythical man-montlt"
O. ~o~ much will we hav~ fo add t<?. the, cost o~ each product to cover our NRE cost, tj
1.28 Assume a designer's prQductivity when working alone on a project is 5 000 transist
. _ ~ull).ing we sell: (a) 100 uruts, and (b) 10,000 wuts? :
• 1.10 cite a graph-with the x-axis the number of units and the y-axis the product cost. Plot ; per month_: Ass~e that each additional designer reduces productivitr by 5'¾ ;:~
the per-product cost function for an NRE of $50,000 and a unit cost of$5. f, k~ep m mmd this 1s an_ e_xtremely simplified model of designer productivity!) ;;/Plot
. 1- For a particular product, you detennine the NRE cost and unit cof.t to be the following [' team ,monthly producltv1ty versus team size for team sizes ranging from I to 40
for the three listed IC technologies: FPGA: ($10,000, $50); ASIC: ($50,000, $10); ~ designers. (b) Plot on the same graph the project completion time versus team size for
VLSI: ($200,?00, $5). Determine precise volumes for which each technology yields the (1 projects of sizes 100,000 and 1,000,000 transistors. (c) Provide the "optimal" number of
lowest total cost. ,, designers for each.of the two projects, indicating the number of months required· h ··,
1.12 Give an example of a recent consumer product whose prime market window was only ~ ~ . m~
~~~ F / 1,,,-J jQ, Q08Jcp '.f ",DOc
1.13 Create an equation for total revenue that combines time-to-market and NRE/unit cost ¢ ./ //,,/ • a
considerations. Use the revenue model of Figure 1. 4(b). Assume a 100-month product [ ,.,.;:i -t!G"(
lifetime, with_ peak revenue of $100,000 month. Compare use o'. a general-purposef' _ o\JC) 7 so• \J ' G
· ·processor havmg an NRE cost of $5,000, a wut cost of $30, and a tune-to-market of 12 1 i v; v l~ ? d,C) . 9 00 ?C -t
~ ;J~~ ~
months (so only 88 months of the product's lifetime remain), with use of a single-!'
purpose processor having an NRE cost of $20,000, a unit c;ost of $10, and a time·-to- p \~ ~o
market of 24 months. Assume the amount added to each unit for profit is $5. /,
1.14 Using a spreadsheet, develop a tool that allows us to plug in any numbers for problem1.
I. 13 and generates a revenue comparison of the two technologies.
1.15 List .and define the three main processor technologies, What are the benefits of using;:
each of the three different processor technologies? f
f l~~/
1.1.6 List and define the three main IC technologies. What are the benefits of using each ofii N \1.-t/' J.k
the three diffe~ent IC technologies? . r ~ ~o0 J_, ;;; I ,..,.,--
1.17 List and define the three main design technologies. How are each of the three different/: Y' Vl- ~,
design technologies helpful to designers? r' / 0
1.18 Create a 3*3 grid with the three processor technologies along the x-axis, and the thre(t\ (if,.. ..)_ 6{)1 QOO. YJ f .
re technologies along the y -axis. For each axis, put the most programmable fonnj ~ ~-
closest to the origin, and the most customized fonn at the end of the axis. Explaillf, / OO ,,.R • 9 [0
features and pOS!iible occasions for using each of the combinations of the two['. d-O
9
L '"
c ·
technolog!es. . . _ _ _
IJ9 Redraw Figure 1.9 to show the transistors per re from 1990 to 2000 on a lmear, nol[i
l ogarithmk, scale. Draw a square representing a 1990 IC and another representing al!
[
sao ~
~ ·cS 33 °'
'3 0 ,:;. ?--0
2000 IC, with correct relative proportions. · t vf '
1.20 Provide a definition of Moore's law. I! J ~ ).,,o _ =
6 ?i- (' {) 50
~ ~ - - - - - - - - - -_-------1':c
26
hl
::=~-=-=-:--~___:_---~~~---:c-=--
Embedded System Design ~ Embedded System Design Lj )°3' - "",.
:)
/
v
~ ~ z:,
ti._ __
.. - ·· . . . ~ ........ l_
~--- - --- - ·- - ~-"-"""'---~www.compsciz.blogspot.in
-- ~·--·---· ·-···
____Ja g ~~.~
-· ~ '"'
·I:_·
}
ti l I
J_•
~:. I
i
J;
i:
t:
2.1 Introduction ·
A processor is a digital cin:uit designed-to perform computatton tasks. A processor consists of
a datapath capable of storing and manipulating data and a controller capable of moving da1a
through the datapath. A general-purpose processor is designed such that it can catty out a
wide variety of computation tasks, which are described by a set of programmer-pr!)Vided
f. instructions. In contrast, a single-purpose processor. is designed specifically to cany out a
! particular computation task. While some tasks are so common that we can purchase standard
single-purpose processors to' implement those tasks, others are unique to · a particular .
embedded system. Sue~ custom tasks may be best implemented using custom single-purpose;
processors that we design ourselves.
An embedded .system designer may obtain several benefits by choosing to use a custom
single-purpose processor rather than a general-purpose processor to implement a computation
task.
t First, performance may be faster, due to fewer clock cycles resulting from a customized
I. datapath, and due to shorter clock cycles resulting from simpler functional units, fewer
1: multiplexors, or simpler controller logic. · Second, size may be smaller,. due to a simpler
www.compsciz.blogspot.in
~----,...
----'-----------------------------
Language: English
*** START OF THE PROJECT GUTENBERG EBOOK TRAINING FOR THE TRENCHES ***
TRAINING FOR THE TRENCHES
LESLIE VICKERS
BY
NEW YORK
GEORGE H. DORAN COMPANY
COPYRIGHT, 1917,
BY GEORGE H. DORAN COMPANY
TO
LIEUT. GORDON ALFORD
OF THE "ANZACS,"
FIGURE 2:
Showing use of sandbag and earth for protection.
Hair. No better advice can be given to the soldier on this subject than "cut it short." The shorter the
better, for when it is short it is easy to keep clean both from body dirt and vermin. In this war soldiers
have almost invariably had the clippers run completely over their heads. Soap and water are as good for
the head as for any other part of the body.
Trunk. It is not always possible for soldiers to get a shower or plunge every day, but a small sponge
carried as part of the equipment will help a good deal. In France, where the water was scarce, we had
to make it go a long way. When the enemy permitted, I used to get my regular morning bath with the
aid of the sponge and about a saucerful of water. I felt like a canary during the process and wanted to
chirp and flap my wings. Soldiers should be encouraged to go in swimming whenever circumstances
permit. To go in swimming was not a military order in my regiment, but we used to take the men to the
sea and then ask who wanted to go in. About eighty per cent of the men would volunteer. Then we
would tell off the remaining twenty per cent for vigorous physical exercises and after ten minutes give
them the choice of continuing or taking a plunge in the sea. They all went in! Men's objections to water
usually come from habit and they soon learn to appreciate its refreshing power.
Feet. "An army marches on its stomach"—metaphorically, but it marches on its feet, literally, as every
poor infantryman knows. And it has to do a good deal of marching in war and in preparation for war.
"Route Marches" and "Hikes" are very popular with the training staff as the soldier will find, and they
are usually planned by the men who ride horses! So important did we consider the care of the feet that
we used to have "Toe Parades" twice a week with the Doctor in attendance. Men with neglected feet
were considered as candidates for cookhouse garbage duty, and were promptly assigned to this task. In
the first place feet must be comparatively clean—soap and water recommended! Then they should be
free from corns. This is not so easy to accomplish. Paring with a knife helps, but if they get too bad the
doctor or the chiropodist should be consulted. Another frequent source of trouble is neglected toe nails.
The best way is to cut them straight across, not too far down, but so as to keep them from tearing the
sock or cramping the foot in the boot. Blisters sometimes arise on the feet. They should be treated at
once, mainly by removing the cause—which may be in the boot itself or the sock—and then by bathing
them in a solution of boric acid. If the socks are kept oiled, or even if small pieces of soap are put into
the boots, this condition will, in large measure, be avoided. I have seen many a pitiful case of men
trailing along the road well in rear of their company, limping and hobbling as best they could, all due to
the fact that they had not paid the attention to their feet that they must if the feet are to do the work
for which the army calls.
A few minutes attention per day given to these points will, I am confident, help to procure and maintain
health for the soldier. But all his care will be wasted unless that which he takes inside his body is
wholesome—food and drink. In camps the soldier usually has all his food cooked for him, and it is the
duty of his officers to see that it is good in quality, sufficient in quantity, and reasonably well cooked. As
the soldier does the serving himself, that is entirely his own lookout. In the trenches it is not possible to
have things arranged as one has in camp. The regimental cookers were usually stationed about three
miles from the firing line—for their safety—and all the food was cooked there and sent up to the lines in
boxes or sandbags, and apportioned to the various platoons according to the number of men on the
strength. Three times a week the cooks were given fresh meat to prepare for us—when the
Government says it is fresh it is fresh even in Summer time and when the flies have been busy—and for
the other days we subsisted on canned meats or "bully beef" as it was called. The meat was either
baked or boiled, though sometimes we got a stew—in camp we got too many stews! Potatoes were
boiled, usually in their jackets. This food we could heat in the trenches in our individual cooking
apparatus, which also served to cook our ration of bacon for breakfast, while in the upper part of the tin
we made tea.
Of course in the trenches we had to eat whatever we could get, but our lot was relieved considerably by
the arrival of delicacies from England by the parcel post. This sometimes subjected us to the temptation
that we were under while in training, and that was to eat pastry and suchlike food, which, while very
appetising, is not to be recommended as a diet for the soldier.
FIGURE 3:
Showing position of body behind earth, and direction of fire
round right side of cover.
On the question of Drink my views have become very pronounced since my experience with the army.
Undoubtedly the best universal drink for the soldier is tea—preferably weak. I should say water were it
always possible to get water that is pure. But during a campaign pure water is a luxury. By making the
water into tea you make sure that it gets boiled, and by the addition of tea you get a beverage that has
not the insipid sickly flavour of boiled or sterilised water. Coffee is preferred by Americans, I know, but
there are dangers to be recognised especially by those whose hearts are inclined to be weak.
With regard to alcohol I would most heartily recommend total abstinence. I need scarcely remind
American readers that there is not a single front rank baseball manager that allows his men to indulge
in alcohol. From my own experience I could tell of many men who were permanently rendered unfit as
soldiers through foolish indulgence. Of the men who were brought before the Colonel for more or less
serious crimes, 90 per cent of them owed their humiliation directly to alcohol, and 5 per cent of them to
alcohol indirectly. I know that it is possible for some men to take alcohol in moderation. Not many
continue to do so, and sooner or later there is almost certain to be an overindulgence. In the British
army men were sentenced to the extreme penalty—death—for being intoxicated while on active service
in France. I say without hesitation that the best men I had were the abstainers and the worst men I
had were the drinkers. Alcohol weakens the tissues of the body, it lowers its vitality and makes it an
easy victim to disease, and worse still, it rapidly obscures the mind. For a war of the kind that is being
waged in Europe a man needs to have his head very clear, and this he cannot do if he is the victim of
the alcohol habit.
Many total abstainers from alcohol are tempted to take "gassy" drinks, fizzes and so forth. These tend
to shorten the wind and should therefore be avoided.
If plain water has to be drunk, care should be taken to see that it is reasonably pure, and all vessels
such as water bottles should be thoroughly rinsed each time before using.
FIGURE 4:
Trench system showing fire, support and reserve trenches;
redoubts; communicating trenches; saps; listening posts, etc.
When these simple rules of eating and drinking are followed many of the dangers incidental to army life
will be avoided, and physical fitness established.
A kindred subject is that of Smoking. This habit has become so universal in the British army that it is
almost true to say that every one smokes. From my own experience I have seen very few ill effects
from it except in cases of obvious overindulgence. But undoubtedly it is easy to overdo the cigarette
business, and on this point I would utter a word of warning. Pipes are to be preferred, though I admit it
is difficult to get men to smoke anything else than cigarettes in the trenches. In the monotony and
strain of trench life, and from the need to do something to keep the stench of decaying bodies from the
nostrils, men do smoke to excess. There is some excuse there, but during training at home every man
must endeavour to be reasonable in his indulgence.
Clothing. I have found that men are very apt to load themselves up with all sorts of useless items of
apparel. In their endeavour to keep warm they have often badly overdone it with the result that they
have found themselves perspiring and exhausted in the midst of an important piece of physical labour.
Of course the soldier will need to see to it that his underclothes are sufficiently warm to keep out the
extreme cold, but it is better to add something to the clothing from time to time—such as a Cardigan
waistcoat—than to be equipped permanently with the heaviest kind of underclothes. Above all, avoid
those garments that are being offered extensively to unsuspecting men, and which, while they will
undoubtedly keep you warm, will also prevent the proper perspiration of the body. The body must be
allowed to perspire and the air must be allowed to carry off the perspiration. Woollens are the best for
this purpose, and though the initial cost of them is rather great, they are worth it in the long run.
Boots. In the paragraph on feet I couldn't help mentioning the matter of boots, but it is so important
that, at the risk of too great repetition, I want to mention it again. You must have boots that are right,
otherwise you will soon be lamed and thus be out of action. And every man out of action "counts two
on a division." We found it advisable in France to get boots that were large enough to accommodate the
feet and two pairs of socks—one thin and one thick pair. Into the boots we poured a small quantity of
oil, or between the socks we put small pieces of soap to keep the feet in good condition. You will find
that the feet must be oiled if they are to stand the work of a campaign.
FIGURE 5:
Showing method of cutting trench; parapet and parados;
drainage.
FIGURE 6:
Showing riveting; flooring made of boards and chicken wire;
drainage.
But sometimes injuries are caused to the feet by other parts of the clothing of a soldier. Men frequently
laced their puttees or leggins too tight and found that they suffered pains in the feet—the circulation
was being stopped. This rendered them very liable to frostbite, than which there is nothing more
painful. If there are signs of freezing, remove the boots as soon as possible and restore the circulation.
But if the feet are actually frozen the soldier is in for a long and tedious illness, and will be lucky if he
does not need to have his feet amputated. I am told that, during the first campaign in the Carpathians,
the Central Powers lost 25,000 men per day with frozen feet.
Before leaving this subject to deal with diseases and their avoidance, I would like to say a word or two
on the congenial subject of Rest. A soldier should get as much of it as he can, consistent, of course,
with doing his duty. Never stand when you could as well be lying down. Throw yourself on the ground
whenever you can, to rest, and let the whole body relax. When you are given a rest on the roadside,
stretch out on your back and breathe as deeply as you can. Give your mind and body alike a vacation
and you will feel the benefit of it at the end of the day. Don't spend your hours of beauty sleep in
talking—get that done during the day. Your body will call for rest after the tiring duties of the day and
you should give it all the rest you can.
FIGURE 7:
Trench with simple dugout under parapet.
FIGURE 8:
Finished dugout, 6' × 4' × 4' with deep entrance and
shrapnel-proofing.
CHAPTER III
DISEASE
If the rules of health set forth in the foregoing chapter are carefully observed, the soldier will be doing
the best he can to keep his body fit. He will be building up a reserve of strength that will stand him in
good stead should the germs of disease find entrance into his body. But there are times when, in spite
of all our precautions, these little microbes get the upper hand, and a long struggle against them
begins. The disease that has been responsible for the death of armies of soldiers is Enteric or Typhoid
fever. During the campaign in South Africa the British lost more men through the ravages of this disease
than through bullets and shells. But during the present war there have been comparatively few cases of
enteric, and the number that have proved fatal is very small. For this result we have to thank the
medical profession that has given so much study and care to the perfection of a method of combating
this disease. The secret has been found to lie in the inoculation of the soldier with small doses of the
disease itself till he becomes comparatively immune to it. Inoculation was not made compulsory in the
first armies that were raised in England after war broke out, but it was made compulsory for men who
desired to become members of the British Expeditionary Force in France. Most men gladly accepted this
medical boon and subjected themselves to this simple and painless operation. But there were others
who objected, sometimes through fear of the pain, and sometimes through what they termed
"conscientious objections." Anti-Inoculation Societies got busy and spread their wretched literature
throughout the camps and made men thoroughly afraid, both of the operation and of its results. To
meet this the War Office issued through the papers and by pamphlets, information from the medical
authorities as to the wonderful results that had already been achieved. They were able to prove beyond
all dispute, that of the men who caught the infection in France, practically all of those who had been
inoculated recovered—their cases being light—while those who had not been inoculated became easy
victims to the disease. As the war has progressed these figures have been amplified till now there can
be no question that the use of "Inoculation" has made this dread disease a thing to be feared less than
the measles.
FIGURE 9:
Finished trench showing parapet and parados; firing step of earth; flooring; and shelter
dugout under parados.
Officers adopted different methods in counteracting the teaching of those who tried to keep the soldiers
from submitting. Some of them argued with the men and told them of the wonderful results that had
been achieved. Others warned their men that they would be left behind when the battalion went to
France. For my own part I adopted the method of sending for the medical men whose business it was
to administer the "dose." When they were all prepared I marched in my men from some light fatigue
work in which they had been engaged, told them to take off their coats and roll up their sleeves, and
three at a time they appeared before the waiting surgeons. The business was over in no time. I
marched them off to a place where I could talk to them and then acquainted them with the advantages
of inoculation. The announcement of forty-eight hours' freedom from drill for the whole company to let
their arms limber up put the few that were disgruntled into good spirits again, and I was able to report
to the O. C. that 100 per cent of my men were willing to be inoculated—and had been inoculated! So
little did any of them suffer from its effects that they readily lined up in ten days time when they were
to receive the second dose. At intervals of two or three months in France the operation was repeated
and I never had a single man on the sick list from enteric!
Now, while inoculation is excellent and should be insisted on in all armies, both for the sake of the
individual soldier and of those who associate with him, every possible precaution should be taken by the
soldier even after this has been done. All water for drinking should be looked upon with suspicion.
Never take any chances for the sake of getting a hasty drink. Many communities have water supplies
that are admirable and when military operations are carried on there, the difficulties disappear. On the
other hand many places have the most abominable water supply systems. Where we were in France,
the country was very flat, and consequently the drainage poor. The buildings that housed the human
beings and the cattle and pigs on the farms were as a rule all built around a "midden" into which flowed
all the refuse. In many cases the family water supply, a well, was dug within three feet of this cesspool,
so that the drainage from the latter was almost sure to reach the former. This is "asking for" enteric,
and some men fell victims to it before they could be made to realise the danger. The best rule to follow,
as we all soon learned, was to get our drinking water exclusively from the army water wagons, for there
the water had been treated and the danger lessened. At times we could not get to the water carts and
a certain degree of risk had to be run.
FIGURE 10:
Machine gun position with heavy overhead cover.
Not only with water has the greatest care to be taken, but also with food. Flies are notorious carriers of
disease, and consequently soldiers must see to it that no food is left uncovered. Nor should food ever
be placed near latrines or any place where there is decaying matter.
With universal inoculation, and with a careful following of these simple rules laid down, the ancient
scourge of the army loses much of its terror. The task of combating it lies mainly with the medical and
sanitary staff, though the common soldier must also play his part of carefulness. Some men carried
small sterilisers with them. This practice is not to be recommended for it is very difficult to keep these
little utensils clean, and then they themselves become harmful. Tabloid sterilisers I have found to be
effective in an emergency.
Those who have followed the history of the war will remember how the Serbian Army was threatened
with extinction through the deadly disease called Typhus. There is no doubt that the army and most of
the civil population would have been wiped out had it not been for the timely assistance that that brave
little nation received from medical men and women throughout the world, notably America. Many of
these brave souls made the final great sacrifice in their endeavour to stamp out this disease. Then again
its horrors have been more recently brought to our notice through the revelations of the conditions at
Wittenberg Camp in Germany. The story that Captain Vidal and Major Priestly, Officers of the Royal
Army Medical Corps, had to tell of their living death in that awful internment camp, brought home to the
British people and then to the world, the frightfulness of that disease, as well as the inhumanity of
certain German medical officials. Fortunately, typhus has been little known in Western Europe, and it is
possible that soldiers in this country will never know its ravages. But all the same it is as well to be
prepared for it, and to know the methods of preventing its outbreak. It is a disease that is carried by
flees and lice and consequently the most that can be said in a work of this kind is to recommend the
greatest pains in the removal of these creatures from the body should they ever take up their residence
there. I refer the reader to the chapter on "Vermin" for methods of combating "Lice."
Dysentery, Enteritis, and Colitis. These names are applied to various kinds and grades of stomach
troubles, between which it is difficult for the common soldier to differentiate, and which show
themselves with most distressing effects. They come, usually, from drinking bad water or eating bad
food. Even with the greatest care that the Commissariat could take, there were occasions when food
unfit for human consumption was served to the troops. In the trenches it was not to be wondered at
that we were stricken with these diseases, for the flies that infested the trenches and lived on the dead
bodies there, favoured us with many visits at food time and poisoned the latter for us. There is no way
that I know of to prevent it, and the sufferer will be well advised to report to the medical officer for
skilled treatment. Cases of dysentery were not very frequent in France, but they were in Gallipoli where
the food supply left much to be desired.
Tetanus is a disease that is brought about by infection which enters the system through a wound. In the
early part of the war it occurred only too frequently till, in this case also, the skill of the medical
profession provided us with a serum to combat it. The universal practice now is to inoculate with anti-
tetanic serum just as soon as possible after a wound has been received. By this means tetanus, like
enteric, is rapidly ceasing to be regarded as a menace.
I have no intention of exhausting the whole category of diseases to which man—and therefore the
soldier—is heir, but simply to touch upon those that are most likely to occur in a campaign. The
foregoing list includes, I believe, all the most likely, but to them I should like to add these two—Smallpox
and Cholera. To deal first with smallpox, we can say, fortunately, that it is rare. This is due in large part
to the almost universal provision of vaccination, which should be insisted upon in an army. Cholera is of
rare occurrence, and nothing can be done to ward it off except to follow carefully the ordinary rules of
health and sanitation. Should it, unfortunately, break out, the army must place itself unreservedly in the
hands of medical authorities who are especially qualified to deal with it.
There is one other disease that has made its effects felt on almost every army, and which it has been
found impossible to thoroughly eliminate. The hands of those who would lessen its influence are to a
great extent tied, because in the past, the only method that has been permissible to eliminate venereal
disease has been what I shall call "the Moral method"—the appeal to morality and the intelligence of
the individual soldier. We have used this excellent and praiseworthy method for generations, but it has
never been found capable of eradicating the evil. Some other means, from an army point of view, has
obviously to be resorted to. But even to discuss the matter, one runs the risk of being ruled out of court
by those who will admit none but the aforementioned "moral argument."
When the first Expeditionary Force went to France, the late Lord Kitchener, then Secretary of State for
War, issued an appeal to the men, in which he besought them to be on their guard against two of the
evils that lessen the efficiency of soldiers—wine and women. The men who fell victims to wine or
whiskey or other forms of alcoholic intemperance, were punished, first of all with imprisonment, and
then, when it was seen that this penalty did not meet the case, the death penalty was imposed for such
as became intoxicated when at their post of duty. Obviously the army cannot afford to have as its
guardians men who cannot keep sober. Those who fell victims to loose women and contracted venereal
diseases—and it is beyond a doubt that most of the women who follow an army are diseased—had to
be withdrawn from their positions and sent back to the bases to hospitals. Every man, therefore, who
violated Lord Kitchener's advice, was playing into the hands of the enemy to this extent that he was
taking the risk of contracting a disease which would rob the army of his services. My own Colonel used
not to mince words on this subject but used to say that such men might just as well go over to the
enemy at once. But with every kind of pleading and threat on the part of officers, it was found that
there were men who disregarded their advice. A soldier's pay automatically stops under these
circumstances, and at first it was the custom to acquaint his family with the fact that he had been sent
to such and such a hospital, and the people of England soon got to know the purpose of these
hospitals, and many a home suffered shame from the indiscretions of the men who represented them in
France. When the Australian troops were quartered near Cairo—than which there are few more immoral
cities in the world—venereal cases were frequent, in spite of the admonitions of the combatant officers
and of the medical staff. What was to be done? Every effort was made to restrain the men and keep
them out of the notorious red light district, but case after case of the disease turned up. Eventually
some of the medical men hit upon the scheme of establishing at the entrance to the various camps,
tents to which men could go on their return from the city. In those tents there was a representative of
the Army Medical Corps equipped with all the latest appliances in the form of prophylactics, and these
were administered without charge and without question, even as to name, to all who sought this
method of protecting themselves after acts of indiscretion. The result was very gratifying from the
medical standpoint, for the number of those who contracted the disease rapidly declined and the
efficiency of the army was maintained at a correspondingly high standard. Of course a protest was
immediately entered by those who were particularly interested in the morals of the men, and the charge
was made that it was putting a premium on immorality. For my own part, interested in both of these
matters, I have come to the conclusion that the old methods have failed, and that I would rather have
an army immoral and well than an army immoral and diseased. As human nature is constituted at
present I can see no alternative, though I believe it to be our bounden duty to continue to urge the
need of self-restraint. I do not fear that these words will be taken to cast a slur upon any army, for
those of us who are not blind are perfectly aware that the same kind of immorality exists among civilian
populations as in armies. For those men who shall read these words of mine I would with all the force
at my command urge the close following of the precepts of Lord Kitchener.
FIGURE 11:
Simple entanglements made of barbed wire and rough posts.
A kindred problem with which the authorities sometimes have to deal is that of "unnatural men."
Records of the German Army before the war contained many examples of this most revolting form of
perversion. In the British Armies that were raised at the outbreak of the war, several cases occurred, the
offenders being punished with terms of imprisonment varying from seven to fifteen years with hard
labour—much too lenient.
The whole problem is most difficult to deal with, and any one who attempts to deal with it risks public
censure. Yet the problem must be faced, nevertheless, and the sooner we apply sane methods to its
solution, the better. Of course views will differ as to what constitutes sane methods, but I am convinced
from my own experience with soldiers that the method outlined above is a good one. We must not,
however, fail to emphasise the dangers that men run. They must be taught the folly of it. We must
make it plain to them that it is not worth the candle to run the risk of contracting the most horrible
diseases that even our advanced medical science can never cure with certainty, for the sake of a brief
gratification. A man's whole life may be ruined; his innocent children afflicted with a loathsome disease;
his wife made to endure years of physical and mental torment as the price of that foolish act. Were this
book a moral treatise I should spend time in driving this point home with more force. But as the object I
desire to achieve is to show men how they can become soldiers and remain fit, it must suffice to say
again that the surest way to lay up misery for yourself, to render yourself unfit to remain at your soldier
tasks and thus increase the odds of the enemy against your side is to run the risk of venereal disease
through contact with women.
CHAPTER IV
VERMIN
I feel that no hints on health would be complete without some brief reference to the "terrors of the
trenches"—Lice. A learned Professor of one of the Universities of England published a little book whose
exact title I have forgotten but which was something like this—"Flees, Lice and Bugs, or, the Little
Brothers of the Prussian." That is pretty hard on the enemy—or the lice—but it serves to emphasise one
important point and that is, that the ravages of these vermin is so great that they can well be said to be
fighting the same cause as the enemy. In spite of all a soldier can do, lice are sure, sooner or later, to
overtake him. They make their nests in the straw upon which he throws himself when fatigued, or in
the walls of houses, or on other human beings, and contact is almost sure to bring them. They are most
interesting little pets whose sole interest in life seems to be to lay eggs and thus make sure that their
race shall be perpetuated. The female louse takes up her abode upon the soldier's body and
immediately sets herself to an egg laying competition. If she gets five minutes start of her victim she
lays up for him weeks of trouble, and the only thing to do is to go after her and her eggs as soon as her
presence is made known. I discovered my first louse while I was at luncheon in the trenches. I seized
the spot on my arm where I believed her to be, and calling to my orderly hurried off to the fields some
distance behind the lines. There we began the hunt which ended, I am happy to be able to say, in her
decease. But the eggs had been laid and not for weeks did I succeed in ridding myself of these
unwelcome boarders. I was, much against my will, used as a perambulating incubator, and only the
greatest vigilance served to rid me of the pests.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebookname.com