SlideShare a Scribd company logo
1 of 784
Download to read offline
EMBEDDEDSYSTEMS
EMBEDDEDSYSTEMS
A01_9788131787663_FM.indd i
A01_9788131787663_FM.indd i 7/3/2012 4:16:57 PM
7/3/2012 4:16:57 PM
The teacher, who is indeed wise, does not
bid you to enter the house of his wisdom
but rather leads you to the threshold of
your mind.
—Khalil Gibran
A01_9788131787663_FM.indd ii
A01_9788131787663_FM.indd ii 7/3/2012 4:16:58 PM
7/3/2012 4:16:58 PM
EMBEDDEDSYSTEMS
EMBEDDEDSYSTEMS
LYLABDAS
Department of Electronics and Communication Engineering
National Institute of Technology Calicut
Kozhikode, Kerala
An Integrated Approach
A01_9788131787663_FM.indd iii
A01_9788131787663_FM.indd iii 7/3/2012 4:16:58 PM
7/3/2012 4:16:58 PM
A01_9788131787663_FM.indd iv
A01_9788131787663_FM.indd iv 7/3/2012 4:17:02 PM
7/3/2012 4:17:02 PM
Copyright © 2013 Dorling Kindersley (India) Pvt. Ltd.
Licensees of Pearson Education in South Asia
No part of this eBook may be used or reproduced in any manner whatsoever without the publisher’s prior
written consent.
This eBook may or may not include all assets that were part of the print version. The publisher reserves the
right to remove any material present in this eBook at any time.
ISBN 9788131787663
eISBN 9789332511675
Head Office: A-8(A), Sector 62, Knowledge Boulevard, 7th Floor, NOIDA 201 309, India
Registered Office: 11 Local Shopping Centre, Panchsheel Park, New Delhi 110 017, India
This book is dedicated
to my children
and
to all my students
A01_9788131787663_FM.indd v
A01_9788131787663_FM.indd v 7/3/2012 4:17:02 PM
7/3/2012 4:17:02 PM
A01_9788131787663_FM.indd vi
A01_9788131787663_FM.indd vi 7/3/2012 4:17:02 PM
7/3/2012 4:17:02 PM
This page is intentionally left blank.
vii
Preface xiii
About the Author xix
Part I Design Aspects of Embedded Systems 1
0 Basics of Computer Architecture and the Binary Number System 3
0.1 Basics of Computer Architecture 3
0.2 Computer Languages 8
0.3 RISC and CISC Architectures 10
0.4 Number Systems 11
0.5 Number Format Conversions 13
0.6 Computer Arithmetic 21
0.7 Units of Memory Capacity 30
Key Points of this Chapter 31
Questions 31
Exercises 32
1 Introduction to Embedded Systems 34
1.1 Application Domain of Embedded Systems 35
1.2 Desirable Features and General Characteristics of Embedded Systems 35
1.3 Model of an Embedded System 37
1.4 Microprocessor vs Microcontroller 37
1.5 Example of a Simple Embedded System 40
1.6 Figures of Merit for an Embedded System 41
1.7 Classification of MCUs: 4/8/16/32 Bits 42
1.8 History of Embedded Systems 44
1.9 CurrentTrends 45
Key Points of this Chapter 45
Questions 46
Exercises 46
2 Embedded Systems—The Hardware Point of View 47
2.1 Microcontroller Unit (MCU) 48
2.2 A Popular 8-bit MCU 50
2.3 Memory for Embedded Systems 64
2.4 Low Power Design 78
2.5 Pullup and Pulldown Resistors 79
contents
A01_9788131787663_FM.indd vii
A01_9788131787663_FM.indd vii 7/3/2012 4:17:02 PM
7/3/2012 4:17:02 PM
viii CONTENTS
Key Points of this Chapter 84
Questions 85
Exercises 85
3 Sensors, ADCs and Actuators 86
3.1 Sensors 87
3.2 Analog to Digital Converters 97
3.3 Actuators 104
Key Points of this Chapter 130
Questions 131
Exercises 132
4 Examples of Embedded Systems 133
4.1 Mobile Phone 133
4.2 Automotive Electronics 139
4.3 Radio Frequency Identification (RFID) 143
4.4 Wireless Sensor Networks (WISENET) 145
4.5 Robotics 146
4.6 Biomedical Applications 150
4.7 Brain Machine Interface 151
Key Points of this Chapter 156
Questions 156
Exercises 157
5 Buses and Protocols 158
5.1 Defining Buses and Protocols 158
5.2 On-board Buses for Embedded Systems 166
5.3 External Buses 172
5.4 Automotive Buses 188
5.5 Wireless Communications Protocols 194
Key Points of this Chapter 202
Questions 203
Exercises 203
6 Software Development Tools 204
6.1 Embedded Program Development 204
6.2 Downloading the Hex File to the Non-volatile Memory 211
6.3 Hardware Simulator 215
Key Points of this Chapter 216
Questions 216
Exercises 217
Part II Software Design Aspects 219
7 Operating System Concepts 221
7.1 Embedded Operating Systems 223
7.2 Network Operating Systems (NOS) 223
A01_9788131787663_FM.indd viii
A01_9788131787663_FM.indd viii 7/3/2012 4:17:02 PM
7/3/2012 4:17:02 PM
CONTENTS ix
7.3 Layers of an Operating System 223
7.4 History of Operating Systems 224
7.5 Functions Performed by an OS (Components of an OS) 225
7.6 SomeTerms Associated with Operating Systems and Computer Usage 230
7.7 The Kernel 231
7.8 Tasks/Processes 234
7.9 Scheduling Algorithms 239
7.10 Threads 250
7.11 Interrrupt Handling 251
7.12 Inter Process (Task) Communications (IPC) 252
7.13 Task Synchronization 257
7.14 Semaphores 265
7.15 Priority Inversion 266
7.16 Device Drivers 268
7.17 Codes/Pseudo Codes for OS Functions 272
Key Points of this Chapter 287
Questions 287
Exercises 288
8 Real-time Operating Systems 290
8.1 Real-timeTasks 290
8.2 Real-time Systems 294
8.3 Types of Real-timeTasks 294
8.4 Real-time Operating Systems 296
8.5 Real-time Scheduling Algorithms 298
8.6 Rate Monotonic Algorithm 302
8.7 The Earliest Deadline First Algorithm 306
8.8 Qualities of a Good RTOS 308
Questions 309
Exercises 309
9 Programming in Embedded C 311
9.1 Embedded C 311
9.2 PIC Programming Using MPLAB 328
Key Points of this Chapter 331
Questions 331
Exercises 332
Part III Popular Microcontrollers Used
in Embedded Systems 333
10 ARM—The World’s Most Popular 32-bit
Embedded Processor (Part I – Architecture
and Assembly Language Programming) 335
10.1 History of the ARM Processor 335
10.2 ARM Architecture 344
10.3 InterruptVectorTable 348
A01_9788131787663_FM.indd ix
A01_9788131787663_FM.indd ix 7/3/2012 4:17:02 PM
7/3/2012 4:17:02 PM
x CONTENTS
10.4 Programming the ARM Processor 349
10.5 ARM Assembly Language 349
10.6 ARM Instruction Set 352
10.7 Conditional Execution 356
10.8 Arithmetic Instructions 357
10.9 Logical Instructions 359
10.10 Compare Instructions 360
10.11 Multiplication 361
10.12 Division 362
10.13 Starting Assembly Language Programming 363
10.14 General Structure of an Assembly Language Line 364
10.15 Writing Assembly Programs 365
10.16 Branch Instructions 366
10.17 Loading Constants 370
10.18 Load and Store Instructions 375
10.19 Readonly and Read/Write Memory 381
10.20 Multiple Register Load and Store 382
Key Points of this Chapter 389
Questions 389
Exercises 390
11 ARM—The World’s Most Popular 32-bit
Embedded Processor (Part II – Peripheral
Programming of ARM MCU Using C) 391
11.1 Block Diagram 392
11.2 Features of the LPC 214x Family 393
11.3 Peripherals 397
11.4 ARM 9 424
11.5 ARM Cortex-M3 424
Key Points of this Chapter 427
Questions 428
Exercises 428
12 Cypress’s PSoC: A Different Kind of MCU 429
12.1 How to get a PSoC Development Kit 430
12.2 The PSoC Family 433
12.3 PSoC1 434
12.4 The Internal Architecture of PSoC 437
12.5 The Digital Sub System 443
12.6 GPIO Pins 453
12.7 Digital Applications Using PSoC 456
12.8 The Analog Section 463
12.9 System Resources 473
12.10 PSoC3 and PSoC5 476
Key Points of this Chapter 477
Questions 478
Exercises 479
A01_9788131787663_FM.indd x
A01_9788131787663_FM.indd x 7/3/2012 4:17:02 PM
7/3/2012 4:17:02 PM
CONTENTS xi
13 The 8051 Microcontroller:
The Programmer’s Perspective 480
13.1 History and Family Details of 8051 480
13.2 8051:The Programmer’s Perspective 482
13.3 Assembly Language Programming 485
13.4 Internal RAM 491
13.5 The 8051 Stack 493
13.6 Processor StatusWord (PSW) 495
13.7 Assembler Directives 496
13.8 Storing Data in Code Memory (ROM) 497
13.9 The Instruction Set of 8051 499
13.10 Port Programming 514
13.11 Subroutines (Procedures) 520
13.12 Delay Loops 522
Key Points of this Chapter 527
Questions 527
Exercises 528
14 Programming the Peripherals of 8051 529
14.1 Pin Configuration of 8051 529
14.2 Programming the Internal Peripherals 533
14.3 Timers of 8051 535
14.4 Counter Programming 545
14.5 Interrupts of 8051 548
14.6 Serial Communication 558
Key Points of this Chapter 565
Questions 565
Exercises 566
15 DSP Processors 567
15.1 The Application Scenario 568
15.2 General Features of Digital Signal Processors 569
15.3 SIMDTechniques 581
15.4 The SHARC Floating Point Processor 587
15.5 DSP Processors ofTexas Instruments (TI) 590
15.6 OMAP (Open Multimedia Applications Platform) 592
Key Points of this Chapter 594
Questions 595
Exercises 595
Part IV Design and Performance Aspects 597
16 Automated Design of Digital ICs 599
16.1 History of Integrated Circuit (IC) Design 599
16.2 Types of Digital ICs 599
A01_9788131787663_FM.indd xi
A01_9788131787663_FM.indd xi 7/3/2012 4:17:02 PM
7/3/2012 4:17:02 PM
xii CONTENTS
16.3 ASIC Design 605
16.4 ASIC Design:The Complete Sequence 609
Key Points of this Chapter 612
Questions 612
Exercises 612
17 Hardware Software Co–design and Embedded Product Development
Lifecycle Management 613
17.1 Hardware Software Co-design 614
17.2 Modelling of Systems 616
17.3 Embedded Product Development Lifecycle Management 620
17.4 Lifecycle Models 626
Key Points of this Chapter 629
Questions 629
Exercises 629
18 Embedded Design: A Systems Perspective 630
18.1 ATypical Example 631
18.2 Product Design 633
18.3 The Design Process 637
18.4 Testing 654
18.5 Bulk Manufacturing 655
Key Points of this Chapter 657
Questions 657
Exercises 658
Part V Projects 659
19 Academic Projects 661
19.1 Project No: 1 661
19.2 Project No: 2 675
19.3 Project No: 3 683
Key Points of this Chapter 693
Questions 693
Exercises 694
Appendix A 695
Appendix B 700
Appendix C 710
Appendix D 729
Bibliography 741
Index 745
A01_9788131787663_FM.indd xii
A01_9788131787663_FM.indd xii 7/3/2012 4:17:02 PM
7/3/2012 4:17:02 PM
xiii
Preamble
Writing a book on Embedded Systems is not easy—let me list a few reasons to substantiate this
statement. The first reason is that the field of embedded systems is very vast. The second is that there
is no clear understanding on what exactly a student of engineering should learn about embedded
systems.A great number of products which are classed as embedded systems are available,and the field
is very sophisticated, well developed and rapidly expanding. Anything from a printer to an iPhone is
an embedded system.To write a book on all this is quite difficult on account of not having a clear idea
of where to start and where to end.
To complicate matters further, there are different families of embedded processors. A student
cannot be expected to learn all of them, or even some of them. To make a decision on what to
include and what not to, has been difficult, Besides that, ‘embedded processors’ is not the only topic
to learn. There is a large set of various kinds of sensors, actuators, buses, operating systems, design
methodologies, view points, development models and what not.
But after a lot of contemplation, finally, I converged on a few popular and upcoming processors,
latest buses,new approaches,traditional as well as modern peripherals,real time operating systems and
the like. A lot of literature for all these is available in the form of technical documents, data sheets and
user manuals—right from the USB technical spec to PSoC’s data sheets
Rummaging through all these highly sophisticated technical information,trying to make sense of
it all, and finally presenting it in a way that a student, albeit an eager and enthusiastic one, will be able
to enjoy reading and studying it—this is the challenge involved in writing this book. I have tried my
best to address this challenge of making it a student-friendly presentation.
There are a number of books available under the title of ‘Embedded Systems’. Except for a few,
most of them have simply concentrated on the architecture and application details of one particular
processor. Others have concentrated on the software aspects alone. There are certain others that deal
with both,but since the field of embedded systems is one in which fast evolution is the rule rather than
the exception, some topics become outdated quite fast.
Approach
I have started from the hardware basics, proceeded to discuss some important processors and systems,
and then moved on to the software aspects. The book ends with a presentation on embedded design
from a system point of view. Along with the basics, I have also tried to focus on the latest and most
relevant topics in the field, from the latest processors and buses to the latest trends in embedded
computing.
Pre-requisite
A student of CS, EC or EE branch who has done a first course in digital logic and a second course
in ‘microprocessors and microcontrollers’, is best placed to take up a course on Embedded Systems.
preface
A01_9788131787663_FM.indd xiii
A01_9788131787663_FM.indd xiii 7/3/2012 4:17:02 PM
7/3/2012 4:17:02 PM
xiv PREFACE
But it is possible also to study Embedded Systems as a second course—that is why
some very basic ideas of microprocessors and microcontrollers are included in the initial
chapters.
Organization of the Book
This book is organized as twenty chapters numbered from 0 to 19. It is divided into five
logical parts from Part I to Part V.
Part I
This part, which includes chapters 0 to 6, deals with the basics, the hardware aspects
including sensors, actuators, buses etc. and the tools commonly used in system
development.
Chapter 0 is a revision of computer arithmetic and computer architecture. One needs
to be very thorough in these two basic topics—then the path ahead becomes very
comfortable.
Chapter 1 introduces readers to what an embedded system is, and what its mandatory
parts are. Examples of practical and popularly used embedded systems are listed to make
the introduction clear. The classifications, history and current trends in the embedded
industry are also touched upon.
Chapter 2 is a very important chapter—any student who needs to use/learn embedded
hardware should become conversant and confident about all the topics covered in this
chapter.Not only are the important aspects of typical embedded processors covered here,
related topics such as semiconductor memory (RAM and Flash),low power design,con-
cepts of pullup and pulldown resistors are also touched upon.
Chapter 3 is very important for practical design of systems. Most students are likely to
do hardware based projects as part of academic requirements—this chapter, which gives
an in-depth discussion on sensors and actuators will definitely find use then.
Chapter 4 is meant for a light reading on some of the applications of embedded systems.
Mobile phones, robotics, RFIDs, automotive electronics, medical electronics etc. are
discussed as popular applications. A new idea called ‘brain machine interface’ is also
introduced in this chapter.
Chapter 5 is meant to be studied as a very important topic. It contains explanations of
some of the popular buses used in embedded systems. A student is not expected to study
all buses in detail, but a general idea of buses, and a study of some of the important ones
is advised. On-board and off-board buses, wired and wireless buses, bus standards, bus
arbitration etc are the important topics covered here.
Chapter 6 is a brief introduction to the development tools that are needed to take a proj-
ect to completion.The discussion is meant to guide students in the right direction when
they are confused about the techniques for writing programs, testing them and burning
them into hardware.
A01_9788131787663_FM.indd xiv
A01_9788131787663_FM.indd xiv 7/3/2012 4:17:02 PM
7/3/2012 4:17:02 PM
PREFACE xv
Part II
This is the second part of the book,and there are three chapters here.This part deals with
software design aspects. Chapter 7 is quite lengthy, but it should mandatorily be learned
because it gives answers to many aspects of computers and embedded systems that are
seen and experienced in everyday life. This chapter covers operating system concepts in
detail and then offers codes/pseudo codes where OS concepts are tried out.
Chapter 8 is about ‘real time operating systems’.This should be considered as a continu-
ation of the previous chapter, But here the special requirements and scheduling policies
for a special class of embedded systems i.e., real time systems, are taken up. Numerical
problems are worked in both these chapters to understand the scheduling mechanism
used in operating systems.
Chapter 9 is a short chapter, being at best a basic introduction to Embedded C. It
assumes that the reader has a basic knowledge of the constructs of ‘C’. How this high-
level language is used for processor programming is the focus of the discussion, which
is based on the 8051 architecture. Some codes for PIC are also included. Later chapters
of PSoC and ARM contain more coding using Embedded C, but basic ideas are intro-
duced here, in Chapter 9.
Part III
This part consists of Chapter 10 to Chapter 15. The architecture, programming and
applications of some of the most widely used and popular processors are covered in
reasonable depth.
Chapters 10 and 11 are devoted to the ARM processor, which is the most popular pro-
cessor used in 32-bit and high-end applications. Chapter 10 explains the core of ARM
and follows it up with assembly language programming. Chapter 11 expands ARM
architecture to make it a microcontroller. A specific ARM-based MCU is chosen and
its peripherals are studied. Programming of some peripherals using C is done.These two
chapters are likely to be sufficient to get a good grip on ARM architecture.
Chapter 12 is about a new processor. It is not new in the embedded design world, but
the academic world is just getting familiarized with it – the chapter discusses PSoC,
an MCU series, which makes life easier for a product designer. This is because of the
graphical IDE it has, and other special features that are covered (with programming
examples in Embedded C) in the chapter.
Chapters 13 and 14 are about one of the most widely used 8-bit microcontroller i.e., the
8051. This MCU is simple and the first that a student should study. These two chapters
discusses this MCU with assembly language programming. All the peripherals are cov-
ered, and programming is explained with worked-out examples.
Chapter 15 contains a general coverage of DSP processors. Such processors are increas-
ing in relevance and the time is just right to learn the special features of such chips.
The special features of such processors are first explained, and then some popular DSP
processors (BlackFin, SHARC, OMAP etc) have been identified, and their features
elaborated.
A01_9788131787663_FM.indd xv
A01_9788131787663_FM.indd xv 7/3/2012 4:17:02 PM
7/3/2012 4:17:02 PM
xvi PREFACE
Part IV
This part includes Chapters 16, 17 and 18.
Chapter 16 deals with ASIC design. It starts with the classification of digital ICs,
continues with programmable devices and then gives a step-by-step explanation of how
a digital IC is designed, tested and fabricated. The reader can get a good idea of what
terms such as front-end design,back-end design etc.mean,without going very deep into
the process of ASIC design.
Chapter 17 introduces two new terminology.One is ‘Hardware Software Co-design’and
the other is ‘Embedded Product Development Lifecycle’.Both these terms are explained
and elaborated upon, with relevant examples.
Chapter 18 is very special. After all the previous chapters, it looks upon an embedded
product as a system, and suggests the steps needed to apply embedded systems to
make useful products as demanded by users. The user/users might have their viewpoint
expressed before the design starts. New concepts like user research, ergonomics, anthro-
pometry etc are introduced. Starting from the desires of users, the design steps reach the
final stage of product manufacture and resting.
Part V
This part has just one chapter. Chapter 19 has a concise discussion of three projects done
by students.The projects pertain to embedded hardware and software and use advanced
processors—ARM, OMAP and PIC. This chapter is meant to encourage students to
take up challenging and innovative ideas and build products based on these ideas.
Appendices
The book has appendices from A to K. Only Appendix A to D are in the text book,
The rest are available in the website of the book www.pearsoned.co.in/lylabdas/
embeddedsystems.
The contents of the appendices are as listed:
A - The instruction set of 8051
B - A step-by-step guide to using the Keil RVDK for 8051 and ARM
C - A step-by-step guide to using the PSoC Designer
D - Pin configuration and PINSEL register configuration of LPC 2148
E - A manual with experiments for PSoC1
F - A step by step guide to using PSoC Creator
G - A tutorial on Keil RVDK for 8051 and ARM
H - A program for interfacing a Graphical LCD to PSoC3
I - A program for interfacing an SD card to ARM7 (LPC 2148)
J - A program for using the I2HC interface of PSoC1
K - User manual of ARM LPC 2148
In addition, PowerPoint presentations and solution manual of the chapters are available
for instructors.
A01_9788131787663_FM.indd xvi
A01_9788131787663_FM.indd xvi 7/3/2012 4:17:02 PM
7/3/2012 4:17:02 PM
PREFACE xvii
Contact
Your suggestions and feedback are welcome. In spite of my best efforts, it is possible that
some errors may have crept in. Please point them out to me.
My contact id is lbd@nitc.ac.in
ACKNOWLEDGEMENTS
This is my second major book,and as I complete it,I would like to acknowledge all those
who have helped and encouraged me in this Herculean task. Truly, it has been a great
effort to write it, and there are a lot of people who have directly or indirectly helped me.
Let me start from the beginning.
The team at Pearson Education provided a lot of inputs, suggestions and support
and brought the project to fruition. I feel that Sojan Jose, my editor, and Ramesh M. R
and Vijay Pritha, the production editors have done a tremendous job.
The first batch of students I taught Embedded Systems was the B070EC batch
and the next year, the B080EC batch came in. Both batches expressed enthusiasm and
interest in the topics I taught, and this is the primary factor that gave me the courage to
embark on the venture of writing a book on the subject. I would like to thank each and
every one of them for this.
During the process of writing,a few students helped me directly in bringing the book
to this form. They gave suggestions, performed reviews, and three of them have contrib-
uted by writing a few sections of the book. All of them are working in reputed companies
and I would like to list their names, along with expressing my heartfelt thanks to them.
Nithin Gopinath (Texas Instruments, Bangalore), Sabu Paul (Texas Instruments,
Bangalore) and Sai Krishna K. (Broadcom, Bangalore) are the three who have contrib-
uted directly by writing a few sections in the book.
The list of those who have done reviews of the chapters are: Nithin Gopinath (Texas
Instruments, Bangalore), Jayalal Vijayan (Synopsis, Bangalore), Sai Krishna K. (Broadcom,
Bangalore), Harikrishnan M. (McAfee, Bangalore), Srijit R. (Deloitte, Hyderabad) and
Sushmitha Dandeliya (Assistant Professor, Engineering College, Gwalior).
A few of my colleagues also have helped me in this endeavor, and I extend my
gratitude to them. Raghu C. V., my colleague in the department, has done the writing
of Chapter 18, and has also given me suggestions at various stages of this work. The
names of others with whom I have had discussions on some topics are Sameer S. M.,
Deepthi P. P., Sudheesh George, Bhuvan B. and Rajiv T. R., my department colleagues,
and Jayaraj B.and Anu Mary Chacko of the Computer Science Department.I am grate-
ful to Anand, senior mechanic at the Embedded Systems Lab, who assisted me in all
the hardware work associated with the book. I thank Beljit, Anju and Aswathi who have
drawn the diagrams in the book. I would also like to make a note of acknowledgement
to my son Sagar, for his suggestions on the theme of the front cover of the book.
Two engineers at Cypress Semiconductors, Narayana Swamy, and Geethesh N. S.,
made a detailed review of the chapter on PSoC.Their inputs have enhanced the quality of
the chapter. I am obliged to them and also to Benoy Jose, and Karthikeyan Mahalingam
of Cypress Semiconductors for co-ordinating this activity.
A01_9788131787663_FM.indd xvii
A01_9788131787663_FM.indd xvii 7/3/2012 4:17:03 PM
7/3/2012 4:17:03 PM
xviii PREFACE
It is only because my department gave me free time without the hassles of regular
work that I have been able to complete the book on schedule. All my colleagues have
been helpful in this and I feel that words are not sufficient to express my feelings of
gratitude to all of them. I am deeply indebted to my institute for giving me the freedom
to grow and follow the path I chose.
Chapter 19 of the book contains the project work of a few teams of students. They
have worked systematically and enthusiastically to do projects of good standard, which
require a lot of background study. I congratulate them for the work they have done and
would like to mention their names here. They are: Nithin Gopinath, Jayalal Vijayan,
Ashwin Harikumar, Kurian Abraham, Ebin George, Sushmita Dandeliya, Fahim Bin
Basheer, Jinu J. Alias, Mohammed Favas C., Navas V. and Naveed Farhan K.
I am happy that my family has always been a source of solace for me.
Last, but not the least, I thank all my students once again for the inspiration they
have always been, and continue to be.
LYLA B. DAS
A01_9788131787663_FM.indd xviii
A01_9788131787663_FM.indd xviii 7/3/2012 4:17:03 PM
7/3/2012 4:17:03 PM
xix
about the author
Lyla B. Das is Associate Professor, Department of Electronics Engineering, National Institute of
Technology Calicut (NITC), Kerala. She has a diverse mix of industrial, teaching and research experi-
ence spanning about 30 years. As a young graduate specializing in Electronics and Communications
from the College of Engineering, Trivandrum, Lyla B. Das joined Keltron Controls as Deputy
Engineer in 1981.She joined NITC (then Regional Engineering College,Calicut),as lecturer in 1985
and proceeded to complete her master’s degree in digital communications from the same college.Over
the years, she was successively elevated as Assistant Professor and then Associate Professor, a position
which she currently holds.
Keen to actively seek and impart knowledge, Lyla B. Das currently teaches courses on micro-
processors, microcontrollers, digital system design using VHDL, and system design using embed-
ded processors at the undergraduate as well as postgraduate level. She has presented research
papers in conferences of national and international stature and has worked on numerous projects
based on microprocessors and microcontrollers, such as microprocessor-based voting machines and
microcontroller-based rail track switching system. An avid reader of contemporary research material,
she keeps herself abreast of the current trends in her chosen field and guides students in their M.Tech.
research theses. This book on Embedded Systems is her second book with Pearson Education, the first
one being The X86 Microprocessors, which was published in 2010 and received with wide acclaim.
Lyla B. Das has worked on various projects funded by the ministry of human resource develop-
ment (MHRD) in thrust areas of growth including the setting up of an embedded systems labora-
tory in 2005–2008. She has delivered expert lectures on image compression using wavelets, advanced
microprocessors and microcontrollers, FPGA based systems and embedded systems at several engi-
neering colleges across Kerala. She has also participated in numerous tutorials and workshops con-
ducted by the Indian Institute of Technology (IIT) and the Indian Institute of Science (IISc).She was
a Fellow in the national conference on ‘VLSI Design and Embedded Systems’held at IISc Bangalore
(2003) and IIT Mumbai (2004). She is a life member of the System Society of India and a member of
the Indian Society for Technical Education and the Computer Society of India.
A01_9788131787663_FM.indd xix
A01_9788131787663_FM.indd xix 7/3/2012 4:17:03 PM
7/3/2012 4:17:03 PM
A01_9788131787663_FM.indd xx
A01_9788131787663_FM.indd xx 7/3/2012 4:17:03 PM
7/3/2012 4:17:03 PM
This page is intentionally left blank.
PART-I
DESIGN ASPECTS
OF EMBEDDED SYSTEMS
M00_9788131787663_C00.indd 1
M00_9788131787663_C00.indd 1 7/3/2012 12:08:16 PM
7/3/2012 12:08:16 PM
M00_9788131787663_C00.indd 2
M00_9788131787663_C00.indd 2 7/3/2012 12:08:16 PM
7/3/2012 12:08:16 PM
This page is intentionally left blank.
0.1 | Basics of Computer Architecture
0.1.1 | The Block Diagram of a Computer
A computer, as its name indicates is a machine used for computing. Computing, which
many years ago meant arithmetic calculations, has now given way to large amounts of
‘data processing’. As such, it is more reasonable to designate the computer now as a ‘data
processing machine’. For performing its designated tasks, this machine requires many
components, which can broadly be divided as hardware and software. Hardware is obvi-
ously, the physical constituents of a computer. Software is the collection of programs
which directs the hardware to perform its tasks.
Let us first look at a computer in terms of its hardware. Figure 0.1 shows the archi-
tectural description of a computer system. It shows the major parts of the computer and
also indicates how these parts are connected together, to form the computing machine.
The major parts are the CPU, memory and input/output devices.
The heart of a computer is the ‘central processing unit’. It is this unit which gives
‘life’to a computer.The CPU usually is a ‘microprocessor’, which means that it is usually
a separate and self contained chip. The CPU processes the data given to it, according
to the programs meant to operate on these data. The program consists of ‘instructions’.
These instructions are decoded by the CPU, which generates control signals necessary
In this chapter, you will learn
 The general principles of computer archi-
tecture
 The operation of the data,address and con-
trol buses of a computer
 The distinction between RISC and CISC
computing
 The comparison between assembly and
high level language programming
 The binary, hexadecimal and BCD number
systems
 Number format conversions
basics of computer
architecture and
the binary number
system
0
Chapter-opening image: Firebird robotic platform (Courtesy: Nex Robotics, Mumbai).
M00_9788131787663_C00.indd 3
M00_9788131787663_C00.indd 3 7/3/2012 12:08:16 PM
7/3/2012 12:08:16 PM
4 EMBEDDED SYSTEMS
to activate the arithmetic and logic units of the CPU. As such, the CPU contains the
arithmetic logic unit and the control unit.All these activities are timed and synchronized
by a pulse train of fixed frequency.This is the clock signal, and it also has the job of syn-
chronizing the activity of the CPU with the activity on the bus.
0.1.2 | The System Bus
A bus is collection of signal wires which connect between the components of the com-
puter systems—Figure 0.2 shows that the CPU is connected to the memory as well as
I/O through the system bus,but only one at a time—if the memory and I/O wants to use
the bus at the same time, there is a conflict, as there is only one system bus. The system
bus comprises of the address bus, data bus and the control bus.
The Data Bus The set of lines used to transfer data is called the data bus. It is a bidi-
rectional bus, as data has to be sent from the CPU to memory and I/O, and has to be
received as well by the CPU.The width of the data bus determines the data transfer rate,
size of the internal registers of the CPU and the processing capability of the CPU. In
short, it is a reflection of the complexity of the processor. As we see, the 8086 has a data
bus width of 16 bits, while the 80486 has a 32-bit bus width.Thus the 80486 can process
data of 32 bits at a time while the 8086 can only handle 16 bits.
The Address Bus The address bus width determines the maximum size of the physi-
cal memory that the CPU can access. With an address bus width of 20 bits, the 8086
can address 220
different locations. It can use a memory size of 220
bytes or 1 MB. For
Pentium with an address bus width of 32 bits, the corresponding numbers are 232
bytes
i.e., 4 GB. When a particular memory location is to be accessed, the corresponding
address is placed on the address bus by the CPU. I/O devices also have addresses. In
both cases, it is the CPU which supplies the address, and as such, the address bus is
unidirectional.
The Control Bus The control bus is a set of control signals which needs to be activated
for activities like writing/reading to/from memory/I/O, or special activities of the CPU
like interrupts and DMA. Thus, we see signals like Memory Read, I/O Read, Memory
Write and Interrupt Acknowledge as part of the control bus.These control signals dictate
Figure 0.1 | The block diagram of a computer
CPU
Memory I/O
M00_9788131787663_C00.indd 4
M00_9788131787663_C00.indd 4 7/3/2012 12:08:17 PM
7/3/2012 12:08:17 PM
BASICS OF COMPUTER ARCHITECTURE AND THE BINARY NUMBER SYSTEM 5
the actions taking place on the system bus that involve communications with devices like
memory or I/O. For example, the Memory Read signal will be asserted for reading from
memory. It is sent to memory from the processor. A signal such as ‘Interrupt’is received
by the processor from an I/O device. Hence in the control bus, we have signals traveling
in either direction. Some control lines may be bidirectional too.
Now that we have discussed a computer system in general,let us go a bit deeper into
its individual constituents.
0.1.3 | The Processor
The processor or the microprocessor as we might call it,is the component responsible for
controlling all the activity in the system.It performs the following three actions continu-
ously. See Figure 0.3.
i) Fetch an instruction from memory.
ii) Decode the instruction.
iii) Execute the instruction.
When we write a program, it is stored in memory. Our code has to be brought to the
processor for the required action to be performed. The first step obviously, is to ‘fetch’
it from memory. The next step i.e., decoding, involves the interpretation of the code as
to what action is to be performed. After decoding, the action required is performed.
This is termed ‘instruction execution’. The sequence of these three actions is called the
‘execution cycle’. To do all this, the processor has ‘control circuitry’ to fetch and decode
instructions. The ALU part of the processor performs the required arithmetic/logic
Figure 0.2 | The system bus and its components
Address Bus
Data Bus
Control Bus
I/O Device
I/O Device
I/O Device
Processor Memory
I/O
Interface
M00_9788131787663_C00.indd 5
M00_9788131787663_C00.indd 5 7/3/2012 12:08:17 PM
7/3/2012 12:08:17 PM
6 EMBEDDED SYSTEMS
operations. The sequence of fetch-decode-execute is done continuously and infinitely
by the processor. An important implication of this cycle is that instruction execution is
‘sequential’ in nature—it is only after the first instruction is dealt with, will the second
one be taken up.However,there will be situations when the sequential nature of program
execution is disturbed.This is when a ‘branch’ instruction appears in the sequence, and a
new sequence of instructions will be taken up starting from a new location.
0.1.4 | System Clock
All the activities of the processor and buses are synchronized by a clock, which is as
shown in Figure 0.4 a square wave with a particular frequency. The reciprocal of the
clock frequency is the cycle time T, also called the clock period. T = 1/f where f is the
clock frequency. An execution cycle may require many clock periods. This depends on
the architectural features of the processor, as well as the complexity of the instruction
to be executed. Since an execution cycle also involves fetching instructions and data
from memory, it also depends on how many clock cycles are needed to access memory.
Obviously, the time for execution depends on the clock speed as well. i.e., a clock speed
of 3 GHz implies faster processing than a clock of 1 GHz. However, the technology
used for the processor must be able to support the clock frequency used.
0.1.5 | Memory
The memory associated with a computer system includes the primary memory as well
as secondary memory. However, for the time being, we will think of memory as con-
stituting the primary or main memory only, which is usually RAM (Random Access
F D E F D E F
Execution Cycle
F -Fetch
D -Decode
E-Execute
Execution Cycle
Figure 0.3 | The execution cycle
Figure 0.4 | System clock
1
0
Clock
Cycle
Time
M00_9788131787663_C00.indd 6
M00_9788131787663_C00.indd 6 7/3/2012 12:08:17 PM
7/3/2012 12:08:17 PM
BASICS OF COMPUTER ARCHITECTURE AND THE BINARY NUMBER SYSTEM 7
Memory). Memory is organized as bytes, and the capacity of a memory chip is stated in
terms of the number of bytes it can store.Thus, we can have chips of size 256 bytes, 1KB,
1MB and so on.If a computer has a total memory space of 20 MB it can use RAM chips
of the available capacity to get that much of memory.
There are two basic operations associated with memory—read and write. Reading
causes a data stored in a memory location to be transferred to the CPU, without erasing
the content in memory. Writing causes a new data to be placed in a memory location
(it overwrites the previous value). There is a certain amount of time required for these
operations and this is termed as ‘access time’.
Memory Read Cycle The steps involved in a typical read cycle are:
i) Place on the address bus, the address of the memory location whose content is to be
read.This action is performed by the processor.
ii) Assert the memory read signal which is part of the control bus.
iii) Wait until the content of the addressed location appears on the data bus.
iv) Transfer the data on the data bus to the processor.
v) De-activate the memory read signal. The memory read operation is over and the
address on the address bus is not relevant anymore.
Memory Write Cycle As a continuation, let us also examine the steps in a typical write
cycle.
i) Place on the address bus, the address of the location to which data is to be written.
ii) On the data bus, place the data to be written.
iii) Assert the memory write signal which is part of the control bus.
iv) Wait until the data is stored in the addressed location.
v) De-activate the memory write signal.This ends the memory write operation.
At this stage, we should remember that these operations are synchronized with the sys-
tem clock. An 8086 processor takes at least four clock cycles for reading/writing. These
four cycles constitute the ‘memory read’ and ‘memory write’ cycles for the processor.
Other processors may require more/less clock cycles for the same operations.
0.1.6 | The I/O System
For a computer to communicate with the outside world there is the need for what are
called peripherals. Some of these peripherals are purely input devices like the keyboard
and mouse; some are purely output devices like the printer and video monitor and some
Figure 0.5 | Memory and associated control signals
Memory
Address
Read
Write
Data
M00_9788131787663_C00.indd 7
M00_9788131787663_C00.indd 7 7/3/2012 12:08:17 PM
7/3/2012 12:08:17 PM
8 EMBEDDED SYSTEMS
like the modem transfer data in both directions.All this just means that such I/O devices
are needed for us to use a computer.However,it is difficult for a processor to deal directly
with I/O devices, because of their incompatibility with the processor—each peripheral
is different and the operating conditions, voltages, speeds and standards are not under-
standable to the processor. The processor does not have the necessary control signals to
deal with different peripherals. Hence, the normal practice is for each peripheral to have
a controller which acts as an interface between the peripheral and the processor. This
controller, which may be a special purpose chip, understands the characteristics of the
particular device and provides the necessary control signals to the processor to communi-
cate with the peripheral.Thus, we have specialized controllers for most peripherals—like
the keyboard display interfacing chip, parallel port interfacing chip and serial communi-
cation chip. All these chips are programmable—they have registers for commands, data
and status. By suitably programming these chips, we can get the processor to communi-
cate correctly with any peripheral. Figure 0.6 shows the use of an I/O interface between
an I/O device and a processor. The processor is not shown in the figure, but the system
bus which comes from the processor is shown.
In the final analysis, we can think of a computer that we usually use, as a conglom-
eration of components which include memory and I/O devices of various types, applica-
tions and specifications.
0.2 | Computer Languages
0.2.1 | Machine Language, Assembly Language
and High Level Language
The computer is just a dumb piece of equipment unless we are able to make it work for
us. For that, we must be able to ‘program’it, so that it will perform the tasks we assign it.
Programming a computer entails the use of a language that the computer understands.
The language native to computers is ‘machine language’ which consists of binary ones
and zeros. The computer knows this language, and the series of ones and zeros fed to it
Data
Status
Command
I/O Interface
Address Bus
Data Bus
Control Bus
System
Bus
I/O Device
Figure 0.6 | The I/O system
M00_9788131787663_C00.indd 8
M00_9788131787663_C00.indd 8 7/3/2012 12:08:17 PM
7/3/2012 12:08:17 PM
BASICS OF COMPUTER ARCHITECTURE AND THE BINARY NUMBER SYSTEM 9
are ‘operation codes’ for it, which tells it what action is to be performed. Thus there is
one binary code for addition and another one for subtraction.These operation codes are
called ‘opcodes’and this language is called ‘machine language’. Programming in machine
language means writing the opcodes of the tasks we want to get done by the computer.
However, the problem with machine language, as is obvious, is that it is cumbersome
and error-prone. Human beings are not good at remembering or using binary codes.
Programming using machine language is not something that any one of us is likely to
enjoy. To make it easier for us to communicate with computers, there is a language at
a slightly higher level and that is called ‘assembly language’. This is more intelligible to
users than machine code.This language uses ‘mnemonics’for specifying the operation the
computer is to perform.These mnemonics are a direct translation of the machine code to
a symbol.For example,the binary code for addition is replaced by the symbol ‘ADD’—the
binary code for multiplication is given the symbolic name ‘MUL’. The exact mnemonic
used depends on the processor type, but it will be related to the operation to be done.
How does this help? A user does not have to remember binary codes or enter binary
code for programming. He only needs to remember the symbolic codes and the asso-
ciated syntax. We say that assembly coding is at a higher level than machine coding.
However, does the computer understand the mnemonics? No, which means that should
be an interface between assembly language and machine language. This interface con-
verts the symbolic codes fed in by the user into machine codes.The software which does
this is called an ‘assembler’.
Since machine language is native to a processor, each processor will have its own
machine language and thus it has its own assembly language also. Translating from
assembly language to machine language and vice versa is a one to one process—one
opcode translates to a unique machine code for a particular processor.
However, we human beings always look for easier ways to get things done. So there
are ‘higher level languages’ which has the vocabulary and grammar similar to the lan-
guage spoken by us.Such languages are very easy to use because the communication pro-
cess is similar to English.We have heard of languages like C,FORTRAN,COBOL and
many, many such ‘high level languages’.The features of such languages are that they are
i) easy to understand and write,
ii) are not processor specific.
Thus if we write a program in C, we can use it to run on any processor—as long as the
‘compiler’ for the language is available. The compiler is the software which ‘translates the
high level language statements’to statements in a lower level language.The lower level may
be assembly or machine language. However, finally the processor needs the machine code.
The program that we write in assembly or high level language is called the source
program or source code.A compiler or assembler converts this into an object code which
is ‘executable’ in the sense that the processor understands the code and performs the
tasks indicated.
0.2.2 | Comparison
Programming in machine language is too cumbersome and hence ruled out in the pres-
ent world. However, assembly language programming is frequently done, so let us now
M00_9788131787663_C00.indd 9
M00_9788131787663_C00.indd 9 7/3/2012 12:08:18 PM
7/3/2012 12:08:18 PM
10 EMBEDDED SYSTEMS
make a comparison between assembly language programming and high level language
programming.
Assembly code is specific to a processor—which means that the assembly code of
8086 does not make any sense to 8085 (though both are Intel made).Assembly programs
need the programmer to know the architecture of the processor intimately. He should
know the registers and flags and the way each instruction handles data.So doing assembly
coding involves the study of the concerned processor. However, once this part is done,
coding is very efficient, compact and executes very fast. Speed advantage of a hundred
times or more,is fairly common.Assembly language programming also gives direct access
to key machine features essential for implementing certain kinds of low level routines,
such as an operating system kernel or microkernel, device drivers, and machine control.
High level language programming, on the other hand, is not processor-specific. It
is easy to learn and master. However, high level languages are abstract.Typically a single
high level instruction is translated into several (sometimes dozens or in rare cases even
hundreds) executable machine language instructions. The object code generated by a
compiler is usually not compact. However, the advantage of high level languages is that
since it is easy to learn, semi-skilled designers can be employed for development activi-
ties, and so development and maintenance times are much less.
This book focuses on the x86 architecture and on assembly language programming.
The aim is to impart good assembly language skills and a thorough knowledge of the
x86 architecture.
0.3 | RISC and CISC Architectures
Two terms that are likely to be encountered frequently while reading about computer
architecture are RISC and CISC. RISC stands for Reduced Instruction Set Computer
and CISC means Complex Instruction Set Computer. Since a lot of controversy sur-
rounds these two terms, let us try to find out what it is all about.
In the early days of microprocessor development, the trend was to have complex
instructions implemented fully using hardware. For example, the multiply instruction is
a complex instruction which needs a dedicated hardware multiplier. Because hardware
is fast, execution is fast, but with lots of such complex instructions, the hardware budget
is naturally high.This is the philosophy and the main feature of CISC.
RISC on the other hand, views this matter in a different way. On an average, the
number of complex instructions a computer uses is relatively less. So, why not realize a
complex instruction using a set of simple instructions? This is possible, and the advan-
tage is that the hardware budget is much less.The instruction set is also small. However,
software is to be written to realize complex instructions with simple instructions. This
amounts to trading software for hardware.
There exists a long history of controversy regarding which is better. The x86 archi-
tecture was based on the CISC philosophy, right from the beginning. By the time RISC
principles became popular and software development for RISC became established, the
x86 CISC processors had already carved a niche for themselves in the processor market.
So,even though the supporters of RISC were able to establish their point,most develop-
ers did not want to take the risk of switching over to an untested domain.However,most
of the newer processors used the RISC philosophy for their architectures—examples
M00_9788131787663_C00.indd 10
M00_9788131787663_C00.indd 10 7/3/2012 12:08:18 PM
7/3/2012 12:08:18 PM
BASICS OF COMPUTER ARCHITECTURE AND THE BINARY NUMBER SYSTEM 11
are ARM, Power PC, Sun’s Sparc processors and the like. Many of them found their
applications in the embedded processing field.
The main features of RISC are that they have only simple instructions implemented
in a single clock. However, there is an irony in that, many RISC processors have as many
complex instructions as CISC processors. Probably this can be justified by explaining
that such complex instructions have been implemented using microprogramming rather
than a direct hardware realization. Microprogramming is a method of implementing
the control unit of a computer by breaking down instructions into a sequence of small
programming steps.
While the RISC versus CISC controversy is still raging, the distinction between
what exactly is RISC and what is CISC is reducing to the extent of being almost indistin-
guishable except at the basic philosophical level. Intel which held on to CISC for many
years, bowed down to the RISC architecture by designing its Pentium Pro with complex
instructions which internally were broken down to simple RISC like instructions. So the
comment on it is that Pentium Pro is a RISC processor than runs CISC instructions.
0.4 | Number Systems
Motivation In the study of microprocessors, we will have to use many different num-
ber systems, and conversions from one system to the other. Clarity of these ideas is very
important for correct computation and the right interpretation of results. This is the
motivation for a review on it, though most of you have had an introduction to it already.
We have become quite used to the number system which we call the decimal num-
ber system, which is a system with a base (radix) 10. We are so used to this system of
numbers that our visualization of quantity is always based on this. Our mental faculties
are tuned to perform all calculations in this number system. In contrast, computers are
not comfortable with this system—we know that they use the binary system of numbers
and all computations are done in the binary format. Thus we have a problem when we
use computers to perform computations for us. So let us start this discussion by first
understanding the intricacies of each of the commonly used number systems. We will
discuss the ones that we most often might have to use in the context of computers.
0.4.1 | The Decimal System
The base of this system is 10 (ten)—and it naturally follows that there are ten defined
symbols in this system—the combinations of these ten symbols give us various values.
The ten symbols here are 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9, and they are called ‘digits’.The posi-
tion of a digit in a number is what gives its value.
For example, how does the number 346 get its value?
346 = 3 × 102
+ 4 × 101
+ 6 × 100
= 300 + 40 + 6
This means that, associated with each position, there is a weight. Here the weight is a
power of 10.Thus
56785 = 5 × 104
+ 6 × 103
+ 7 × 102
+ 8 × 101
+ 5 × 100
= 50000 + 6000 + 700 + 80 + 5
M00_9788131787663_C00.indd 11
M00_9788131787663_C00.indd 11 7/3/2012 12:08:18 PM
7/3/2012 12:08:18 PM
12 EMBEDDED SYSTEMS
What about fractional numbers? The positions on the right side of the decimal number
also have weights, but the powers (of 10) are negative.
6.785 = 6 × 100
+ 7 × 10−1
+ 8 × 10−2
+ 5 × 10−3
= 6 × 1 + 7 × 0.1 + 8 × 0.01 + 5 × 0.001
= 6 + 0.7 + 0.08 + 0.005
These are things that we know very well.They have been reviewed here to show that the
same concept applies to other number systems as well.
0.4.2 | The Binary Number System
The base of this system is 2,and so it has two symbols,0 and 1,each of them being called
a bit. So each position has a weight which is a power of 2.Take the number 110110. Let
us find its value. Since there are 6 bits, there are six positions with weights as shown for
the bits:
Power of 2: 25
+24
+23
+22
+21
+20
Weight: 32 +16 +8 +4 +2 +1
Number: 1 1 0 1 1 0
Value: 1 × 32 +1 × 16 +0 × 8 +1 × 4 +1 × 2 +0 × 1
Adding the values in all the bit positions gives 32 + 16 + 0 + 4 + 2 + 0 = 54. This is the
equivalent value in the decimal system.We cannot help putting back everything into the
decimal system, because this is the number system with which we are most familiar and
comfortable.
Note Sometimes binary numbers are suffixed with B to indicate that they are binary
numbers e.g., 110110B, 1010110B. Sometimes the notation 1101102
is also used.
Note Keep the calculator in the PC (Accessories of Windows) open in the scientific
mode.This will help to verify all the calculations we are going to do from now on.
Next, let us try to understand the concept of fractional binary numbers.
Example 0.1
Find the decimal values of the binary number 1001.011 B
Solution
Power of 2: 23
22
21
20
2−1
2−2
2−3
Weight 8 4 2 1 0.5 0.25 0.125
Number 1 0 0 1 . 0 1 1
Value 8 + 0 + 0 + 1 . 0 + 0.25 + 0.125
= 9.375
Example 0.1 shows 1001.011 in binary (often written as 1001.0112
).
It also shows the power and weight or value of each digit position. Thus 1001.001 is
equivalent in decimal to 9.375 (8 + 1 + 0.25 + 0.125).
Notice that this is the sum of 23
+ 20
+ 2−2
+ 2−3
, but 22
and 21
are not added, as the bit
under these positions is 0.The fractional part is composed of 2−2
and 2−3
, but there is no
digit under 2−1
, so 0.5 is not added.
M00_9788131787663_C00.indd 12
M00_9788131787663_C00.indd 12 7/3/2012 12:08:18 PM
7/3/2012 12:08:18 PM
BASICS OF COMPUTER ARCHITECTURE AND THE BINARY NUMBER SYSTEM 13
0.4.3 | The Hexadecimal Number System
Next is the hexadecimal system of numbering which has 16 symbols namely 0, 1, 2, 3, 4,
5, 6, 7, 8, 9, A, B, C, D, E, F.The base of the system is 16 and each symbol is called a ‘hex
digit’. Each position in the hexadecimal number system has a weight which is a power of
16.Let us find the value of 240FCH.The letter ‘H’is suffixed to the number if it is needed
to make clear that it is a hexadecimal number. A to F have the decimal values of 10 to 15.
Power of 16: 164
+163
+162
+161
+160
Weight: 63536 +4096 +256 +16 +1
Number: 2 4 0 F C
Value: 2 × 65536 +4 × 4096 +0 × 256 +15 × 16 +12 × 1
i.e., 131072 +16384 +0 +240 +12
= 147708
So we have calculated the equivalent decimal value of the given hex number by using the
concept of positional weights.
Example 0.2
Find the decimal value of the hex number 25.1H
Solution
Power of 16: 161
+160
+16−1
Weight: 16 +1 +0.0625
Number: 2 5 . 1
Value 2 × 16 +5 × 1 . +1 × 0.0625
i.e., 32 +5 . +0.0625
= 37.0625
There is also an octal system whose base is 8. The equivalent calculations involved in
this are left as an exercise for the interested student. In all the above, we have done the
conversion to decimal form from other number systems. Now we will see how we will
convert a decimal number to other systems of numbering.
Note i) In most computers, the default number system for writing numbers is deci-
mal. When we mean decimal numbers, we simply write it as it is—like 35,
687 and 234 and so on. A number in hex form is suffixed with the letter H,
for example, 56H, 8FH, 0AH and so on.
ii) The numbers from 0 to 9 are the same in the decimal and the hexadecimal
system.So,in the forthcoming chapters,you will see that no ‘H’is added when
writing numbers from 0 to 9, though there is nothing wrong in writing 7H,
8H, 01H and so on.
0.5 | Number Format Conversions
0.5.1 | Conversion from Decimal to Binary
The method is to divide the decimal number by 2, until the quotient is 0. See the tech-
nique illustrated below.
M00_9788131787663_C00.indd 13
M00_9788131787663_C00.indd 13 7/3/2012 12:08:18 PM
7/3/2012 12:08:18 PM
14 EMBEDDED SYSTEMS
Example 0.3
Find the binary value of 13.
Solution
Divide 13 by 2 repeatedly and save the remainders
2)13 remainder = 1
2)6 remainder = 0
2)3 remainder = 1
2)1 remainder = 1
0
Now write the remainders from bottom to top, as one line from left to right. We get
1101 as the converted binary number.
Thus, we have been able to convert from decimal to binary by repeated division by 2, the
base of the binary number system. To verify, try converting this binary number back to
decimal. It should be 13. Or simply use the scientific calculator to verify the conversion.
(Make sure it is kept open on your PC’s desktop.)
Example 0.4
Convert the number 213 to binary form.
Solution
2)213 remainder = 1
2)106 remainder = 0
2)53 remainder = 1
2)26 remainder = 0
2)13 remainder = 1
2)6 remainder = 0
2)3 remainder = 1
2)1 remainder = 1
0
Now write the remainders from bottom to top in one line,from left to right.The number
is 11010101.
0.5.2 | Conversion from Decimal to Hexadecimal
Conversion from decimal to hexadecimal is accomplished by dividing by 16 and finding
the remainders.Remainders ranging from 10 to 15 will be written using the hexadecimal
symbols A to F. See how 225 is converted to a hexadecimal form.
16)225 remainder = 1
16)14 remainder = E
0
Result = E1
The method for this is obvious i.e.,divide repeatedly the decimal number by 16,keep the
remainders. Do this until the quotient is 0.
M00_9788131787663_C00.indd 14
M00_9788131787663_C00.indd 14 7/3/2012 12:08:18 PM
7/3/2012 12:08:18 PM
BASICS OF COMPUTER ARCHITECTURE AND THE BINARY NUMBER SYSTEM 15
Example 0.5
Convert the decimal number 4152 to hexadecimal.
Solution
16)4152 remainder = 8
16)259 remainder = 3
16)16 remainder = 0
16)1 remainder = 1
0
Take the remainders from bottom to top and write it in a single line from left to right.
The number is 1038H.
0.5.3 | Converting from Binary to Hexadecimal
If we take any hex digit,note that its decimal value ranges from 0 to 15.For example F is
15,A is 10 and so on.If a hex digit has to be converted to a binary number,the maximum
number of bits required is 4.
SeeTable 0.1.Any hex digit can be written as a group of four bits.Taking an example,
4C57FH can be written in binary, by writing the equivalent binary of each of the digits
Hex 4. C 5 7 F
Binary 0100 1100 0101 0111 1111
The binary value of 4C57FH is 01001100010101111111. Looking at both the
representations tells us the biggest problem with binary numbers—they are long and
cumbersome to handle. Putting them into a hex form makes the representation short
and concise—we conclude that the binary representation is an expanded form of the
hexadecimal representation where each hex digit is expanded to its 4-bit binary form.
If we have a long binary number, what we can do to convert it into hex form is to
divide it into groups of 4 bits (starting from the right i.e., the LSB). Then write the hex
representation of each 4-bit binary group. Try this technique with the following binary
number: 11100101010100011101.
1110 0101 0101 0001 1101 B i.e., binary
E 5 5 1 D H i.e., hex
Table 0.1 | Hex, Binary and Decimal Representations
Decimal Hex Binary Decimal Hex Binary
0 0 0000 8 8 1000
1 1 0001 9 9 1001
2 2 0010 10 A 1010
3 3 0011 11 B 1011
4 4 0100 12 C 1100
5 5 0101 13 D 1101
6 6 0110 14 E 1110
7 7 0111 15 F 1111
M00_9788131787663_C00.indd 15
M00_9788131787663_C00.indd 15 7/3/2012 12:08:18 PM
7/3/2012 12:08:18 PM
16 EMBEDDED SYSTEMS
Example 0.6
Convert the following binary number to hex form.
10111110000111110001.
Solution
It is the practice to write binary as groups of four with a space between the groups.This
increases the readability of the binary number.
1011 1110 0001 1111 0001
A E 1 F 1
The equivalent hex number is AE1F1H.
Example 0.7
Convert the following hexadecimal number to binary form.
3AF24H
Solution
Take each hexadecimal digit and write its equivalent four-bit binary value.
3 A F 2 4
0011 1010 1111 0010 0100
From all this, we should realize that the hexadecimal notation is a contracted form of rebi-
nary number representation. Computers do all their processing using binary numbers, but
it is easier for us to represent that binary number in hex form.So when we ask the computer
to add 34H and 5DH, it actually expands these into binary form and does the addition.
0.5.4 | BCD Numbers
BCD stands for ‘Binary Coded Decimal’ but there is more to it than being just a binary
representation of a decimal number. Let us look into the details.
Decimal numbers are represented by 10 symbols from 0 to 9, each of them being
called a digit. We know the binary code for each of these decimal numbers. Suppose we
represent one decimal digit as a byte,it is called ‘unpacked BCD’.Consider the represen-
tation of 9—it is written as 00001001. Now if we want to write 98 in unpacked BCD,
it is written as two bytes:
9 8
00001001 00001000.
Thus the binary code of each decimal digit is in one byte.
Packed BCD What, then, is ‘packed BCD’? When each digit is packed into 4 binary
bits, it is packed BCD.Thus 98 is
9 8
1001 1000.
Each digit needs a nibble (four bits) to represent it. The packed BCD form of 675 is
0110 0111 0101.The important point to remember is that since there is no digit greater
M00_9788131787663_C00.indd 16
M00_9788131787663_C00.indd 16 7/3/2012 12:08:18 PM
7/3/2012 12:08:18 PM
BASICS OF COMPUTER ARCHITECTURE AND THE BINARY NUMBER SYSTEM 17
than 9, no BCD nibble can have a code greater than ‘1001’. Computers do process BCD
numbers, but the user must be aware of the number representation that is being used.
Can we write BCD numbers in hex? Yes, because the hex representation is just a
concise representation of binary numbers. The decimal number 675 when written as
675H represents the packed BCD, in hex form. There is no need to be confused about
this, because the steps involved are:
i) write the binary equivalent of each decimal number, as a nibble,
ii) write the hex equivalent of each nibble.
675 is
0110 0111 0101
6 7 5 H
Spend a few moments thinking, to make it clear. One important point to keep in mind
is that when we represent BCD in hex form, no digit will ever take the value of A to F,
since decimal digits are limited to 9.So there will never be a BCD number such as 8F5H
or 56DH or A34H.
Example 0.8
Find the binary, hex and packed BCD representation of the decimal numbers 126 and
245. Also write the packed BCD in the hex format.
Solution
Number Binary Hex BCD BCD in hex
form
126 0111 1110 7EH 0001 0010 0110 126H
245 1111 0101 F5H 0010 0100 0101 245H
Example 0.9
Find the packed BCD value of the decimal number 2347654, and represent the BCD
in hex format.
Solution
To find the BCD, each digit is to be coded in 4-bit binary.
Hence 2347659 is
0010 0011 0100 0111 0110 0101 1001 i.e., 2347659H is the hex representation of the
BCD number.
It is very important to keep this in mind, when we do programs using BCD arithmetic.
Whenever you have doubts then, just refer back to this chapter.
0.5.5 | ASCII Code
This word pronounced as ‘ask-ee’ is the abbreviation of the words ‘American Standard
Code for Information Interchange’. This is the code used when entering data through
the keyboard and displaying text on the video display. It is very important to know what
it is and how this code is used.
M00_9788131787663_C00.indd 17
M00_9788131787663_C00.indd 17 7/3/2012 12:08:18 PM
7/3/2012 12:08:18 PM
18 EMBEDDED SYSTEMS
ASCII is a seven bit code,which is written as a byte.It has representations for numbers,
lower case and upper case English alphabets, special characters (like # , ^ . ) and control
characters.For example,there are ASCII codes for ‘new line’,carriage return and the space
bar. A number of characters are related to printing. When we type a character on the key-
board, it is the ASCII value of the key that is read in.The computer must convert it from
this form to binary form, for processing. The list of ASCII codes is shown in Table 0.2.
Note that the ASCII value of numbers from 0 to 9 is 30H to 39H. The ASCII of upper
case alphabets starts from 41H and that for lower case starts from 61H.This table will be
needed as quick reference for various calculations we will do in the programming chapters.
0.5.6 | Representation of Negative Numbers
There are various ways of representing negative numbers—like signed magnitude, one’s
complement, two’s complement and so on, but we will straightway discuss the represen-
tation used by computers for this. Computers use the ‘two’s complement’ representation
for negative numbers.The method is to complement each bit of the number and add a ‘1’
to this. Let us see how it is done.
We will start with 4-bit numbers. Say we want to represent −6.
i) Write the 4-bit binary value of 6: 0110.
ii) Complement each bit: 1001.
iii) Add ‘1’ to this: 1010.
So –6 is ‘1010’, for computers.
Let us try this for all the numbers from 0 to 7. See Table 0.3 which shows the posi-
tive and negative number representation of numbers possible to be represented in four
bits. A number of observations can be made from Table 0.3.
i) The range of numbers that can be represented by 4 bits is −8 to +7. For an n-bit
number, this range works out to be (−2n−1
) to (+2n−1
−1).
ii) In this notation, the most significant bit (MSB) is considered to be the sign bit.The
MSB for positive numbers is ‘0’ and for negative numbers is 1.
iii) There is a unique representation for 0.
Since we will deal mostly with bytes and words (16-bit) let’s have a feel of 8-bit negative
number representation.
Example 0.10
Find the two’s complement number corresponding to −6 when 6 is represented in 8 bits
as 0000 0110.
Solution
The steps: 0000 0110
1111 1001 ;complement each bit
1111 1010 ;add ‘1’ to it
F A ;in hex
Thus −6 is FAH in 8-bit form, while it is AH in 4-bit form (from Table 0.3)
Note H is the notation for ‘hexadecimal’.
M00_9788131787663_C00.indd 18
M00_9788131787663_C00.indd 18 7/3/2012 12:08:18 PM
7/3/2012 12:08:18 PM
BASICS OF COMPUTER ARCHITECTURE AND THE BINARY NUMBER SYSTEM 19
Table 0.2 | The ASCII Code—Symbols versus Hex Value
Symbol ASCII
(Hex)
Symbol ASCII
(Hex)
Symbol ASCII
(Hex)
Symbol ASCII
(Hex)
NUL 0 DLE 10 (Space) 20 0 30
SOH 1 DC1 11 ! 21 1 31
STX 2 DC2 12 “ 22 2 32
ETX 3 DC3 13 # 23 3 33
EOT 4 DC4 14 $ 24 4 34
ENQ 5 NAK 15 % 25 5 35
ACK 6 SYN 16  26 6 36
BEL 7 ETB 17 . 27 7 37
BS 8 CAN 18 ( 28 8 38
Tab 9 EM 19 ) 29 9 39
LF A SUB 1A * 2A : 3A
VT B ESC 1B + 2B ; 3B
FF C FS 1C , 2C  3C
CR D GS 1D - 2D = 3D
SO E RS 1E . 2E  3E
SI F US 1F / 2F ? 3F
@ 40 P 50 ` 60 P 70
A 41 Q 51 a 61 q 71
B 42 R 52 b 62 r 72
C 43 S 53 c 63 s 73
D 44 T 54 d 64 t 74
E 45 U 55 e 65 u 75
F 46 V 56 f 66 v 76
G 47 W 57 g 67 w 77
H 48 X 58 h 68 x 78
I 49 Y 59 i 69 y 79
J 4A Z 5A j 6A z 7A
K 4B [ 5B k 6B { 7B
L 4C / 5C l 6C 7C
M 4D ] 5D m 6D } 7D
N 4E ^ 5E n 6E ~ 7E
O 4F – 5F o 6F 7F
M00_9788131787663_C00.indd 19
M00_9788131787663_C00.indd 19 7/3/2012 12:08:18 PM
7/3/2012 12:08:18 PM
20 EMBEDDED SYSTEMS
One very important point we need to observe and keep in mind is that, when a 4-bit
number is expanded into an 8-bit form, its sign bit has to be extended into the 8 bits.
The sign bit in the 4-bit representation of −6 is ‘1’. When expanding the number to fill
into 8 bits, the 1 is replicated 4 more times to fill the whole byte.Thus −6 which is AH in
4-bit form, becomes FAH in byte form, and will be FFFAH in 16-bit format, and FFFF
FFFAH in 32-bit format. We need to understand this for negative numbers. For positive
numbers, we do it without much thinking. So +6 is 0110, which expands to be 0000 0110
(byte) or 06H, and 0006H in 16-bit format and 0000 0006 H in the 32-bit format. Note
that for positive numbers,the sign bit is 0; effectively we are doing sign extension here too.
This concept of ‘sign extension’is important and we will deal with it in greater detail later.
Conversion from Two’s Complement Form Given the two’s complement representa-
tion of a decimal number, how do we find the decimal number which it represents? The
answer is—two’s complement it again.
Take FA
1111 1010 ...the number
0000 0101 + ...invert each bit
1 ...add 1
0000 0110 ...its 2’s complement
This is 6.Thus FA is the two’s complement representation of −6.
Example 0.11
Find the decimal number whose two’s complement representation is given.
i) FFF2H
ii) F9H
Solution
i) FFF2H
Taking two’s complement gives 000E
which is 1110.i.e.,14—which means that −14 is the number represented by FFF2H.
Table 0.3 | Negative and Positive Number Representation in 4-bit Binary
Negative Numbers Binary Hex Positive Numbers Binary Hex
−8 1000 8
−7 1001 9 + 7 0111 7
−6 1010 A + 6 0110 6
−5 1011 B + 5 0101 5
−4 1100 C + 4 0100 4
−3 1101 D + 3 0011 3
−2 1110 E + 2 0010 2
−1 1111 F + 1 0001 1
−0 0000 0 + 0 0000 0
M00_9788131787663_C00.indd 20
M00_9788131787663_C00.indd 20 7/3/2012 12:08:18 PM
7/3/2012 12:08:18 PM
BASICS OF COMPUTER ARCHITECTURE AND THE BINARY NUMBER SYSTEM 21
ii) F9H
Taking two’s complement gives
0111 i.e., 7, which means that −7 is the number represented by F9H.
Question Looking at the result of various arithmetic operations on binary numbers,
how do we know whether it is a positive or a negative number? What is your observation
regarding signed numbers?
Answer We should know how many bits are used for the representation of a signed
number in the system.Then, if the MSB is a ‘1’, it is a negative number, if the MSB is a
‘0’, it is a positive number.
0.6 | Computer Arithmetic
0.6.1 | Addition of Unsigned Numbers
When we say that a number is unsigned, it implies that the sign of the number is irrel-
evant, which actually means that we consider the numbers as having no sign bit—all the
bits allotted for the data are used for the magnitude alone,in effect,it turns out that these
refer to positive numbers. With 8 bits, numbers from 0 to 255 can be used.
Binary addition is something that you have already learnt. Here we are reviewing it
to bring into focus some important points which we may have to be taken care of, in the
study of microprocessor programming.
Binary addition is done by adding bits column wise.We will consider byte sized data.
Case 1
Binary Decimal Hexadecimal
0101 1001 + 89 + 59H +
0110 1001 105 69H
1100 0010 194 C2H
Addition of the same numbers in the binary, decimal and hexadecimal formats is shown.
Since the sum lies within a value of 255, there is no special problem in this case.
Case 2
0111 1000 120 + 78H +
1001 1001 153 99H
10001 0001 273 111H
In this case, the sum is greater than the number of bits allotted for the operand, and the
extra bit, beyond the 8 bits of the sum, is called a ‘carry’. Whenever a carry appears, it
indicates the insufficiency of the space allocated for the result. In microprocessors, there
is a flag that indicates this condition.
0.6.2 | Addition of Packed BCD Numbers
Now let us add packed BCD numbers
M00_9788131787663_C00.indd 21
M00_9788131787663_C00.indd 21 7/3/2012 12:08:18 PM
7/3/2012 12:08:18 PM
22 EMBEDDED SYSTEMS
Case 1
Consider the case of two packed BCD bytes that are to be added, say 45 and 22.
Packed BCD Packed BCD in hex form Decimal
0100 0101 + 45H + 45 +
0010 0010 22H 22
0110 0111 67H 67
In this case,the upper nibble and lower nibble are within 0 to 9.So the addition proceeds
just like normal decimal addition.
Case 2
Consider the case of two packed BCD bytes that are to be added,say 45 and 27.In BCD
form, the correct answer should be 72. However, this is not obtained directly.
Packed BCD Packed BCD in hex form Decimal
0100 0101 + 45H + 45 +
0010 0111 27H 27
0110 1100 6CH 72
When adding in binary form, the lower nibble of the sum is greater than 9. Since no
BCD digit can have a value greater than 9, a correction needs to be applied here. The
correction to get the sum back to BCD form is to add 6 (0110) to the lower nibble alone.
Correction
0110 1100 +
0000 0110
0111 0010
This gives the correct sum of 72.
Case 3
This is when the upper nibble of the sum is greater than 9.The correction is to add 6 to
the upper nibble alone.
Add BCD 76 and 62. In binary form, the additions are
0111 0110 + 76H +
0110 0010 62H
1101 1000 + D8H + Now adding 6 to the upper nibble,
0110 0000 60H
1 0011 1000 138H
However, note that the data size exceeds 99, which is the maximum s number that 8 bits
can accommodate for a packed BCD number. Thus there is a ‘carry’ generated from the
addition operation. However, if the carry is also included in the answer, the sum of 138
is correct. However, more than 8 bits are needed for the sum.
Case 4
When both the upper and lower nibbles of the sum are greater than 9, add 6 to both
nibbles. Add BCD 89 and 72.
M00_9788131787663_C00.indd 22
M00_9788131787663_C00.indd 22 7/3/2012 12:08:18 PM
7/3/2012 12:08:18 PM
BASICS OF COMPUTER ARCHITECTURE AND THE BINARY NUMBER SYSTEM 23
1000 1001 + 89H +
0111 0010 72H
1111 1011 FBH add 06 to both nibbles
0110 0110 66H
1 0110 0001 1 61H
The right answer of 161 is obtained. However, the sum needs more than one byte space.
Example 0.12
Perform the addition of the following numbers, after converting to decimal and hexa-
decimal forms.
i) 39 and 99
ii) 117 and 156
Solution
Decimal Binary Hexadecimal
i) 39 + 0010 0111 + 27H +
99 0110 0011 63H
138 1000 1010 8AH
ii) 117 + 0111 0101 + 75H +
156 1001 1100 9CH
273 1 0001 0001 1 1 1H
In the second addition, the data has exceeded the size which can be accommodated in
8 bits.Hence a carry will be generated.In microprocessors,there is a flag which indicates
this condition.
0.6.3 | Addition of Negative Numbers
We know now that negative numbers are represented in two’s complement notation.
Let’s consider adding two negative numbers.
Example 0.13
Add −43 and −56
Solution
Convert the two numbers into their two’s complement form, as both are negative
numbers.
−43 + 1101 0101 +
−56 1100 1000
−99 1 1001 1101
We are adding two 8-bit numbers. If the sum exceeds 8 bits, an extra bit is generated
from the addition.Ignore this carry and look at the eight bits of the sum.(This is the rule
for two’s complement addition.)
M00_9788131787663_C00.indd 23
M00_9788131787663_C00.indd 23 7/3/2012 12:08:18 PM
7/3/2012 12:08:18 PM
24 EMBEDDED SYSTEMS
It is 1001 1101.The MSB is found to be ‘1’. So we know that it is a negative number.To
find the decimal number whose two’s complement representation this is, take the two’s
complement of the sum.This comes to be 0110 0011 i.e., 99.Thus, we verify the correct-
ness of our addition procedure.
Example 0.14
Add +90 and −26.
Solution
One number is positive and the other is negative.
+90 0101 1010 +
−26 1110 0110
64 1 0100 0000
Ignore the end around carry.The sum is 0100 0000. Since the MSB of the number is ‘0’,
we understand that the sum is positive. So convert it to decimal.The result is 64.
Example 0.15
Add −120 and +45
Solution
−120 1000 1000 +
+45 0010 1101
−75 1011 0101
Look at the sum—the MSB of the sum is ‘1’. Hence, it is a negative number. The two’s
complement of this is 0100 1011 i.e., 75.Thus, the result of the calculation is −75.
Note In all the above calculations, we have used data of 8 bits.The result of the calcu-
lations was in the range of −128 to +127. Thus, the answers are correct. If the sum goes
outside this (for eight-bit data), the answers will be wrong, and havoc will be created if
one is not aware of that. Computers have ‘flags’ to let us know of this. This will be dis-
cussed in later sections.
0.6.4 | Subtraction
Unsigned Numbers
i) Binary numbers
ii) Hexadecimal numbers
iii) BCD numbers
The procedure here is similar to addition i.e., bit by bit, column by column subtraction.
Sometimes, borrows from the columns on the left are needed.
M00_9788131787663_C00.indd 24
M00_9788131787663_C00.indd 24 7/3/2012 12:08:18 PM
7/3/2012 12:08:18 PM
BASICS OF COMPUTER ARCHITECTURE AND THE BINARY NUMBER SYSTEM 25
Example 0.16
Subtract 56 from 230. Do this subtraction after converting numbers to binary and hex.
Solution
230 – 1110 0110 – E6H –
56 0011 1000 38H
174 1010 1110 AEH
In the above subtraction, we are subtracting a smaller number from a bigger number.
However, when subtracting column-wise, sometimes there is the issue of having to
subtract a bigger number from a smaller number. We know the idea of ‘borrow’ from
the left-hand column. However, for the borrowing with which we append the number,
depends on the base of the number system. For the decimal system, we borrow 10, for
binary 2 and for hex we borrow 16.
Check this hexadecimal subtraction:
E6H –
38H
AEH
Starting from the rightmost column,we see that we cannot subtract 8 from 6.So,borrow-
ing from E is needed.Borrowing from E leaves E to become D and 6 becomes 6 + 16 = 22
(in decimal). Subtracting 8 from 22 gives 14 which is E in hex. That is how we get E in
rightmost column of the result.Then,going over to the left,subtract 3 from D (13 in deci-
mal).This is 10 (in decimal) and A in hex.That is how the result of the subtraction is A.
This idea has been explained here in detail, so that we can use a similar idea in BCD
subtraction.
0.6.5 | Packed BCD Subtraction
Let us use the same numbers for BCD subtraction as we did in Example 0.16. i.e., sub-
tract 56 from 230.The BCD representation is shown below.Each decimal digit is packed
in to 4-bit binary bits.
Decimal Packed BCD
230 – 0010 0011 0000 –
56 0000 0101 0110
174 0001 0111 0100
The point to remember here is that each group of 4 bits represents a ‘decimal number’,
the base of which is ten. Thus, when we try to subtract a bigger number from a smaller
number, we have to consider the ‘four bits together’ as a decimal number. Let us review
the steps in the above subtraction.
First step
Thus, when we have to subtract 6 from 0 in the rightmost group of four bits, we need
to borrow. Borrow from the group on the left a decimal 10, and add it to the ‘0000’ on
M00_9788131787663_C00.indd 25
M00_9788131787663_C00.indd 25 7/3/2012 12:08:18 PM
7/3/2012 12:08:18 PM
26 EMBEDDED SYSTEMS
the right.That makes it ‘1010’(because of borrowing, the 0011 on the left is now ‘0010’).
Then subtract 0110 from this. The result is 0100 as seen (within the group, binary sub-
traction is done).
0010 0010 1010 –
0110
0100
Second step
This is the second group. For subtracting 0101 from 0010, borrowing of decimal 10 is
taken from the leftmost group.Thus 0010 is ‘1100’, 12 in decimal. Subtracting ‘0101’(5)
from it, gives ‘0111’ (7) as shown.
0001 1100 1010 –
0101 0110
0111 0100
Third step
The leftmost group is now 0001. Subtract 0000 from it. Thus, the final answer is 174 in
packed BCD form.
0001 1101 1010 –
0000 0101 0110
0001 0111 0100
All this shows that BCD subtraction also needs extra care as BCD addition. In comput-
ers, special instructions take care of this.
Example 0.17
Express the numbers 53 and 18 in packed BCD and subtract the latter from the former.
Solution
Decimal Packed BCD
53 – 0101 0011 –
18 0001 1000
First step
Borrowing from the left side nibble to the nibble on the right side gives
0100 1101 –
0001 1000
0101
Second step
0100 1101 –
0001 1000
0011 0101
The result is 35, as it should be.
M00_9788131787663_C00.indd 26
M00_9788131787663_C00.indd 26 7/3/2012 12:08:18 PM
7/3/2012 12:08:18 PM
BASICS OF COMPUTER ARCHITECTURE AND THE BINARY NUMBER SYSTEM 27
0.6.6 | Subtraction of Signed Numbers
Subtraction is the process of changing the sign of the second number and adding to the first.
65−34 is 65 + (−34).
So when we do subtraction, we actually add the two’s complement form (i.e., the
negative) of the second number to the first number. This is what computers actu-
ally do when they perform subtraction. In the discussion of subtraction in Section
0.6.4, this was not explicitly mentioned, because the idea then was to present certain
other intricacies related to subtraction. Now let us discuss subtraction for 8-bit signed
numbers. Keep in mind that the range of signed numbers usable with 8 bits is −128
to + 127.
Example 0.18
Perform subtraction of the following signed numbers:
i) +26 from +68
ii) +26 from −68
Solution
i) +26 from +68
This comes to be a computation in the form of 68 + (−26). For this, the two’s comple-
ment form of 26 should be added to 68.
Decimal Binary
68 is 0100 0100 +
−26 is 1110 0110
1 0010 1010
Ignore the extra bit generated. Since the MSB is ‘0’, the result is positive. The result is
0010 1010 i.e., 42.
ii) +26 from −68 i.e., −68 – (26) −68 + (−26)
−68 is (in two’s complement form) 1011 1100 +
−26 1110 0110
−94 1 1010 0010
Ignore the extra bit generated. Since the MSB of the 8-bit result 1010 0010 is ‘1’, the
difference of the two numbers is negative.Take the two’s complement of this. 0101 1110
i.e., 94. So the result of the computation is −94.
Example 0.19
Find the result of the following subtraction:
i) −56 from + 23
ii) −56 from −23
M00_9788131787663_C00.indd 27
M00_9788131787663_C00.indd 27 7/3/2012 12:08:18 PM
7/3/2012 12:08:18 PM
28 EMBEDDED SYSTEMS
Solution
i) −56 from + 23
The computation to be done is +23 – (−56) i.e., 23 + 56. This turns out to be the
addition of the two positive numbers 23 and 56.
23 + 0001 0111 +
56 0011 1000
79 0100 1111 i.e., 79
ii) −56 from −23
The computation to be done is −23 − (−56) i.e., −23 + 56.
−23 + 1110 1001 +
56 0011 1000
33 1 0010 0001
Ignore the extra bit generated. The MSB of the 8-bit result 0010 0001 is ‘0’. So the
number is positive and is 33 in decimal, as it should be.
Overflow into the Signed Bit
Whenever we use 8-bit signed numbers in addition or subtraction, the result is found to
be correct in sign and magnitude if it is within the range of −128 to +127.However,sup-
pose this is violated? What happens then? A typical case is when two negative numbers
are added. Try adding −100 and −55. Both the operands are within the allowed range.
See the addition.
−100 + 1001 1100 +
−55 1100 1001
−155 1 0110 0101
Ignore the extra carry bit and look at the 8-bit result.The MSB of the result is ‘0’indicating
that it is a positive number. However, we know that the answer is negative. What caused
the error? Because the sum was too large (larger than −128) to fit into the 8 bits allotted
to it,there was an ‘overflow into the sign bit’causing the sign bit to be changed.(A similar
issue occurs when we add two positive numbers and the sum is greater than + 127). In
computers there is a flag which tells us when there is an overflow into the sign bit caus-
ing it to be inverted.These matters will be discussed in detail when we do programming.
0.6.7 | Addition of Numbers of Different Lengths
We have discussed computer arithmetic in detail, because it is very important to be clear
about it,so as to be able to understand how the microprocessor responds to different data
types and arithmetic operations. Now let’s try to understand how data of different data
widths are dealt with.
Data can have different sizes depending on the processor.The 8086 can have data of
8 bits and 16 bits, while Pentium can handle 8, 16 and 32 bits internally. Sometimes it
may be required to add/subtract data of different widths. In these cases, the important
thing to do is to equalize the size of the data involved. Processors do not allow addition/
M00_9788131787663_C00.indd 28
M00_9788131787663_C00.indd 28 7/3/2012 12:08:18 PM
7/3/2012 12:08:18 PM
BASICS OF COMPUTER ARCHITECTURE AND THE BINARY NUMBER SYSTEM 29
subtraction of data of different widths. So a byte will have to be converted to a 16-bit
word, if it has to be added to a 16-bit number. The way it is done depends on whether
the data is signed or unsigned. For unsigned data, the byte is appended with zeros in
the upper byte, and converted to a 16-bit word. For signed data, the byte should be ‘sign
extended’ to make it a 16-bit word. Refer Section 0.5.6 once again to convince yourself
of the necessity for this.
Example 0.20
Add the unsigned numbers 35H and 7890H.
Solution
In this, 35H is appended with zeros to make it 0035H.
0035H +
7890H
78C5H
Example 0.21
Add the following signed numbers:
i) 45H and A87CH
ii) A8H and 1045H
iii) F5H and B45CH
Solution
i) In this 45H should be made into a 16-bit number. Check the MSB of this byte. It is
‘0’,meaning that it is a positive number.The sign bit when extended to 16 bits makes
the number 0045H.Then the addition is
0045H +
A87CH
A8C1H
ii) In this the byte is A8H, which has an MSB of ‘1’. Thus, sign extension makes it
FFA8H. Now the addition is
FFA8H +
1045H
1 0FEDH
The extra bit generated is ignored, like we have done in Section 0.7.3 on signed number
computation.
To be sure that this is correct, verification can be done as below.
A8H is −88
1045H is +4165
Adding the two, gives us 4077 whose hex representation is 0FEDH.
M00_9788131787663_C00.indd 29
M00_9788131787663_C00.indd 29 7/3/2012 12:08:18 PM
7/3/2012 12:08:18 PM
30 EMBEDDED SYSTEMS
iii) Add F5H and B45CH
In this, F5H is sign extended to be FFF5H
Adding
FFF5H +
B45CH … note that this is a negative number
1 B451H
Ignoring the extra carry bit, the sum is B451H, a negative number. To verify, find the
decimal equivalents of the numbers which are −11 and −19364, which when added,
give −19375.
Note You may also verify that, without extending the negative sign, a wrong result is
obtained.
All the calculations we have done can be verified easily using the scientific calculator
available on the PC. So, try to be adept in the use of that calculator.
0.7 | Units of Memory Capacity
A memory device is one in which data is stored. How much data a memory device can
store depends on its capacity. The capacity of memory is specified as multiples of bytes
since memory is byte organized, which means that one byte is stored in one location in
memory. So, if there are 100 locations in a memory device, 100 bytes are stored. We all
have heard of memory capacity being mentioned in terms such as bytes, kilobytes and
megabytes. Now let us quantify these terms. You will be hearing these terms throughout
the use of this book.
A byte is 8 bits. A word is not really defined. It depends on the processor used. For
the 8086, a word size is 16 bits. A 32-bit processor may claim to have a word size of
32 bits. Memory capacity is always specified in bytes.
28
= 256 bytes
210
= 1024 bytes = 1KiloByte or 1KB
26
× 210
= 216
= 64 KB = 65, 536 bytes
210
× 210
= 220
= one Mega Byte (1MB) = 1024 × 1024 = 1,048, 576 bytes
210
× 220
= 230
= one Giga Byte (1 GB) = 1024 × 1024 × 1024 = 1,073, 741, 824 bytes
210
× 230
= 240
= one Terra Byte (TB) = 1024 × 1024 × 1024 × 1024
= 1,099, 511, 627, 776 bytes
There are also higher units, which are not so common in usage as yet, but things will
change soon, no doubt about it. Some of these units are:
Peta Byte (PB) = 250
bytes
Exa Byte (EB) = 260
bytes
Zetta Byte (ZB) = 270
bytes
M00_9788131787663_C00.indd 30
M00_9788131787663_C00.indd 30 7/3/2012 12:08:18 PM
7/3/2012 12:08:18 PM
BASICS OF COMPUTER ARCHITECTURE AND THE BINARY NUMBER SYSTEM 31
K E Y P O I N T S O F T H I S C H A P T E R
 A computer system consists of a CPU, memory and I/O which communicate with one
another through the system bus.
 The system bus comprises the data bus, address bus and the control bus.
 A processor’s activities are restricted to fetching, decoding and executing instructions.
 For reading and writing from/to memory, a number of clock cycles of time are required.
The time expended for this is called the memory access time.
 When comparing assembly language programming with high-level language program-
ming, we conclude that the former is faster in execution and more efficient and compact,
but is more difficult to learn and master.
 RISC and CISC are two different philosophies in computer design, and even though a lot
of controversy still rages around which is better, the two seem to have merged, more
or less.
 Computers do all the computations in binary, but for entering data through the keyboard
and for displaying it on the monitor, ASCII codes are used.
 Negative numbers are represented in two’s complement form by all computers.
Q U E S T I O N S
1. Name the three most important components of a computer system.
2. Have you heard of the term‘bus contention’? What does it mean in the context of a com-
puter system?
3. If the data bus width of a processor is 64 bits, what would you say about its complexity
and capability?
4. If the address bus of a processor is 64 bits, what is its address space?
5. What could be a‘multi processing’system?
6. What is the first step in the execution cycle of a processor?
7. How does the system clock frequency influence the speed of processing?
8. If a system uses a 1.5-GHz clock, what is its clock period?
9. What is meant by the word‘system bus’?
10. Why should a computer have an I/O controller?
11. What are the difficulties involved in learning and using assembly language programming?
12. Name one distinguishing feature each of RISC and CISC computers.
13. How are the hexadecimal and binary number systems related?
14. When two signed positive numbers are added and the sum exceeds 127, what is the
problem that arises?
15. What is the range of signed numbers that can be represented in 12 bits?
M00_9788131787663_C00.indd 31
M00_9788131787663_C00.indd 31 7/3/2012 12:08:18 PM
7/3/2012 12:08:18 PM
32 EMBEDDED SYSTEMS
E X E R C I S E S
1. Write the decimal equivalent of the following numbers:
a) 31.3H
b) 1100.101B
c) A32.3H
d) 100101B
2. Convert the following numbers to binary form:
a) 34
b) 200
c) 90
3. Convert to hexadecimal format.
a) 3454
b) 4523
c) 789
4. Write the binary values for:
a) 34ADH
b) 78FH
c) 407BH
5. Write the hexadecimal values of:
a) 11000101010110001B
b) 10011111100001010B
6. Find the packed BCD representation of the following decimal numbers:
a) 45
b) 4678
c) 802345
7. Represent the packed BCD of the following numbers in hex:
a) 235
b) 9123
8. What is the ASCII of each of the following?
a) 7
b) 8
c) 0
d) A
e) Z
f) y
g) d
h) *
i) 
9. Find the two’s complement representation of the following numbers in 8 bits:
a) −45
b) −90
c) −12
d) −34
M00_9788131787663_C00.indd 32
M00_9788131787663_C00.indd 32 7/3/2012 12:08:19 PM
7/3/2012 12:08:19 PM
BASICS OF COMPUTER ARCHITECTURE AND THE BINARY NUMBER SYSTEM 33
10. Represent the following negative numbers using 16 bits:
a) −267
b) −4
c) −5676
d) −675
11. Perform binary addition for the following numbers:
a) 34 and 56
b) −52 and −70
c) −47 and +120
12. Convert to packed BCD and add,
a) 46 and 23
b) 55 and 67
c) 34 and 49
d) 99 and 44
13. Subtract after converting to binary form,
a) −20 from −75
b) +49 from +97
c) E5H from A4H
14. Add the following signed numbers:
a) F3H and 3245H
b) AH and F45H
c) B2H and 123EH
15. How many bytes constitute
a) 5MB
b) 4KB
c) 32MB
d) 32KB
e) 8GB
M00_9788131787663_C00.indd 33
M00_9788131787663_C00.indd 33 7/3/2012 12:08:19 PM
7/3/2012 12:08:19 PM
Introduction
The term ‘embedded systems’ has become very common, but is quite difficult to ‘define’,
because of the large variety of devices included in this class. So, let us make an attempt
to understand it, rather than make an attempt to ‘define’ it.
An embedded system is an electronic system which is designed to perform one
or a limited set of functions, using hardware and software. Thus, let’s examine the vast
domain of embedded systems.
Having hardware and software makes an embedded system a computer, but this
computer performs only a limited set of functions. Thus, we exclude the PC from the
embedded system world, and name it as a general purpose computer. Therefore, an
embedded system is a ‘special purpose’ computing unit—meaning that it will have
a processor and associated software. The software associated with the application is
‘burned’ into the ROM of the processor; therefore, it is better to designate it as a
‘firmware’.
Take the case of an automobile, for example, a car. It has a number of ‘electronic
control units (ECUs)’ as part of what is called ‘automobile electronics’—each of these
units has a processor, which controls one or other of the various parts of the car such
as engine, brakes, lights, doors and so on. Thus, embedded systems are ubiquitous, that
is, omnipresent within an automobile, and adds intelligence to the operation of the
vehicle.
In this chapter, you will learn
 What is meant by the term ‘embedded
systems’
 The application domain of embedded
systems
 The model of an embedded system
 The difference between an MCU and an
MPU
 The working of a simple embedded system
 The figures of merit for an embedded
system
 Classification of MCUs on the basis of
data bus widths
 The history and current trends of the
embedded systems industry
introduction to
embedded systems
1
Chapter-opening image: Development board of TI’s low power MSP 430 microcontroller.
M01_9788131787663_C01.indd 34
M01_9788131787663_C01.indd 34 7/3/2012 12:08:27 PM
7/3/2012 12:08:27 PM
INTRODUCTION TO EMBEDDED SYSTEMS 35
1.1 | Application Domain of Embedded Systems
The application domain of embedded systems percolates every element of modern life—
it will be easier to understand its features once we take a tour of the world of embedded
systems.The following is a list:
i) Consumer electronics: Cameras, music players, TVs, DVD players, microwave
ovens, washing machines, refrigerators and remote controls.
ii) Household appliances/home security systems: Airconditioners, intruders and
fire alarm systems.
ii) Automobile controls: Anti-lock braking system, engine and transmission control,
door and wiper control, etc.
iv) Handheld devices: Mobile phones, PDAs, MP3 players, digicams, etc.
v) Medical equipments: Scanners, ECG and EEG units, testing and monitoring
equipments.
vi) Banking: ATMs, currency counters, etc.
vii) Computer peripherals: Printers, scanners, webcams, etc.
viii) Networking: Routers, switches, hubs, etc.
ix) Factories: Control, automation, instrumentation and alarm systems.
xi) Aviation: Airplane controls, guidance and instrumentation systems.
xii) Military: Control and monitoring of military equipments.
xiii) Robotics: Used in factories, household and hobby-related activities.
xiii) Toys.
Figure 1.1 depicts some embedded products. It is only a sample of the products in
the galaxy of embedded systems.
This list is incomplete, and on perusing it, you are likely to feel that anything and
everything that involves modern day electronic control is an ‘embedded system’. This is
not far from the truth. In fact, the only electronic equipment that we simply and easily
exclude from the list is the home PC.
Why do we exclude the PC from this list?
We will first list out the general features of an embedded system before attempting to
answer this question.
1.2 | Desirable Features and General Characteristics
of Embedded Systems
i) It should have one or a small set of functions which it is expected to perform
efficiently.
ii) It should be designed for low-power dissipation, because many systems are battery
powered.
iii) It has limited memory and limited number of peripherals.
iv) Applications are not meant to be alterable by the user.
v) Many of them are not accessible directly,that is,they may be part of the control unit
of a larger system, so no interference in operation is possible.
vi) They need to be highly reliable.
vii) Many of them need to operate with time constraints.
M01_9788131787663_C01.indd 35
M01_9788131787663_C01.indd 35 7/3/2012 12:08:28 PM
7/3/2012 12:08:28 PM
36 EMBEDDED SYSTEMS
Figure 1.1 | Some application fields of embedded systems
M01_9788131787663_C01.indd 36
M01_9788131787663_C01.indd 36 7/3/2012 12:08:28 PM
7/3/2012 12:08:28 PM
INTRODUCTION TO EMBEDDED SYSTEMS 37
Now let’s try to understand why a PC is not considered to be an embedded system.
i) The PC has a large application set, from word processing and computation to
communications, printing, scanning and many more.
ii) Low power consideration is a good idea, but that is not the guiding principle in
its design.
iii) Memory is available in various forms: RAM, ROM and secondary memory
devices like the hard disk, CDROMs and the like. More memory can be added if
the user desires.
iv) Since the PC is used for various applications,more applications can be added as and
when needed.
v) The PC can be accessed by input devices like the keyboard, mouse, modem, etc.
vi) Like any other system, the PC also needs to be reliable, but since it is unlikely to be
the part of a very critical system, it can afford to fail once in a while (not a very good
idea, though because PCs are used in critical monitoring applications sometimes).
vii) The applications on the PC need to be fast for better performance, but usually there
is no time criticality involved.
Now that we have eliminated the general purpose PC from the list of embedded
systems,the next question is whether the new handheld devices such as advanced mobile
phones, PDAs, etc. can be included in the list of ‘embedded systems’.The answer is that
gradually these devices are also being used for ‘general purposes’, just like a PC. But the
other side of the argument is that the design of such handheld devices is similar to that
of embedded systems, where processor power, memory, size, are limited, and timing is
critical, even though the applications may resemble that of a PC. As such, such devices
can also be thought of as embedded systems.
1.3 | Model of an Embedded System
In its simplest and most general form, an embedded system consists of a processor,
sensors, actuators and memory.The idea is that any application should be able to provide
solution to a real-world problem, for which some data is definitely to be read in. For this,
sensors are needed. This data is processed by the processor and the result of it is given
to actuators which perform appropriate actions. See Figure 1.2, which is a very simple
model of an embedded system.
1.4 | Microprocessor vs Microcontroller
We have already talked about a processor as being the brain of an embedded system.This
simply means that there should be a computational engine as the core of the system, to
make it ‘intelligent’. There are two types of ‘processor units’ commonly mentioned in
the literature.
1.4.1 | Microprocessor Unit (MPU)
A processor like the 8086, or its advanced version, that is, Pentium, has very high
computational capability,but it does not have pins or the internal architecture to interface
with the external world. For such ‘microprocessors’, external chips act as peripheral
M01_9788131787663_C01.indd 37
M01_9788131787663_C01.indd 37 7/3/2012 12:08:30 PM
7/3/2012 12:08:30 PM
38 EMBEDDED SYSTEMS
Processor
S
S
E
N
O
R
S
A
A
C
T
T
U
O
R
S
Memory
Figure 1.2 | General model of an embedded system
Figure 1.3 | An MPU with peripherals and memory external to the chip
MPU
Chip
S
S
Y
T
E
M
B
U
S
RAM
ROM
Parallel I/O
Serial I/O
Counter/
Timer
Other
Peripherals
controllers. For example, to connect an LCD display to an MPU, a parallel port IC is to
be connected externally—to have a serial transmission facility, an external serial control-
ler is necessary—for timing and counting, external timers are needed. Memory can also
be connected externally. Figure 1.3 shows an MPU chip connected to peripherals and
memory which are physically external to the chip. Such MPUs are used as the core of
general purpose computation systems, where the emphasis is on ‘computational power’
rather than interfacing capability. A PC uses an MPU, and a number of external chips
together as a ‘chipset’ which acts as controllers to various peripherals.
M01_9788131787663_C01.indd 38
M01_9788131787663_C01.indd 38 7/3/2012 12:08:30 PM
7/3/2012 12:08:30 PM
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf
Embedded System -Lyla B Das.pdf

More Related Content

What's hot

Embedded Systems (18EC62) - ARM Cortex-M3 Instruction Set and Programming (Mo...
Embedded Systems (18EC62) - ARM Cortex-M3 Instruction Set and Programming (Mo...Embedded Systems (18EC62) - ARM Cortex-M3 Instruction Set and Programming (Mo...
Embedded Systems (18EC62) - ARM Cortex-M3 Instruction Set and Programming (Mo...Shrishail Bhat
 
Bit Serial multiplier using Verilog
Bit Serial multiplier using VerilogBit Serial multiplier using Verilog
Bit Serial multiplier using VerilogBhargavKatkam
 
Vlsi overview & career guidance
Vlsi overview & career guidanceVlsi overview & career guidance
Vlsi overview & career guidanceRichu Jose Cyriac
 
PowerArtist: RTL Design for Power Platform
PowerArtist: RTL Design for Power PlatformPowerArtist: RTL Design for Power Platform
PowerArtist: RTL Design for Power PlatformAnsys
 
vlsi projects using verilog code 2014-2015
vlsi projects using verilog code 2014-2015vlsi projects using verilog code 2014-2015
vlsi projects using verilog code 2014-2015E2MATRIX
 
VLSI circuit design process
VLSI circuit design processVLSI circuit design process
VLSI circuit design processVishal kakade
 
Chapter 02 instructions language of the computer
Chapter 02   instructions language of the computerChapter 02   instructions language of the computer
Chapter 02 instructions language of the computerBảo Hoang
 
Mini Project on 4 BIT SERIAL MULTIPLIER
Mini Project on 4 BIT SERIAL MULTIPLIERMini Project on 4 BIT SERIAL MULTIPLIER
Mini Project on 4 BIT SERIAL MULTIPLIERj naga sai
 
Difference Between CISC RISC, Harward & Von-neuman
Difference Between CISC RISC, Harward & Von-neumanDifference Between CISC RISC, Harward & Von-neuman
Difference Between CISC RISC, Harward & Von-neumanKailas Kharse
 

What's hot (20)

Risc processors
Risc processorsRisc processors
Risc processors
 
Embedded Systems (18EC62) - ARM Cortex-M3 Instruction Set and Programming (Mo...
Embedded Systems (18EC62) - ARM Cortex-M3 Instruction Set and Programming (Mo...Embedded Systems (18EC62) - ARM Cortex-M3 Instruction Set and Programming (Mo...
Embedded Systems (18EC62) - ARM Cortex-M3 Instruction Set and Programming (Mo...
 
Bit Serial multiplier using Verilog
Bit Serial multiplier using VerilogBit Serial multiplier using Verilog
Bit Serial multiplier using Verilog
 
Vlsi power estimation
Vlsi power estimationVlsi power estimation
Vlsi power estimation
 
ASIC DESIGN FLOW
ASIC DESIGN FLOWASIC DESIGN FLOW
ASIC DESIGN FLOW
 
Vlsi overview & career guidance
Vlsi overview & career guidanceVlsi overview & career guidance
Vlsi overview & career guidance
 
PowerArtist: RTL Design for Power Platform
PowerArtist: RTL Design for Power PlatformPowerArtist: RTL Design for Power Platform
PowerArtist: RTL Design for Power Platform
 
vlsi projects using verilog code 2014-2015
vlsi projects using verilog code 2014-2015vlsi projects using verilog code 2014-2015
vlsi projects using verilog code 2014-2015
 
VLSI circuit design process
VLSI circuit design processVLSI circuit design process
VLSI circuit design process
 
bandgap ppt
bandgap pptbandgap ppt
bandgap ppt
 
Vlsi circuit design
Vlsi circuit designVlsi circuit design
Vlsi circuit design
 
Digital Design Flow
Digital Design FlowDigital Design Flow
Digital Design Flow
 
Fpga
FpgaFpga
Fpga
 
Xilinx 4000 series
Xilinx 4000 seriesXilinx 4000 series
Xilinx 4000 series
 
Low Power VLSI Design
Low Power VLSI DesignLow Power VLSI Design
Low Power VLSI Design
 
Chapter 02 instructions language of the computer
Chapter 02   instructions language of the computerChapter 02   instructions language of the computer
Chapter 02 instructions language of the computer
 
Mini Project on 4 BIT SERIAL MULTIPLIER
Mini Project on 4 BIT SERIAL MULTIPLIERMini Project on 4 BIT SERIAL MULTIPLIER
Mini Project on 4 BIT SERIAL MULTIPLIER
 
Introduction to stm32-part1
Introduction to stm32-part1Introduction to stm32-part1
Introduction to stm32-part1
 
ARM Architecture
ARM ArchitectureARM Architecture
ARM Architecture
 
Difference Between CISC RISC, Harward & Von-neuman
Difference Between CISC RISC, Harward & Von-neumanDifference Between CISC RISC, Harward & Von-neuman
Difference Between CISC RISC, Harward & Von-neuman
 

Similar to Embedded System -Lyla B Das.pdf

Bharat gargi final project report
Bharat gargi final project reportBharat gargi final project report
Bharat gargi final project reportBharat Biyani
 
Book Preview: A Practical Introduction to the Xilinx Zynq-7000 Adaptive SoC
Book Preview: A Practical Introduction to the Xilinx Zynq-7000 Adaptive SoCBook Preview: A Practical Introduction to the Xilinx Zynq-7000 Adaptive SoC
Book Preview: A Practical Introduction to the Xilinx Zynq-7000 Adaptive SoCDerek Murray
 
8051 Embedded Programming in C - Book-II
8051 Embedded Programming in C - Book-II8051 Embedded Programming in C - Book-II
8051 Embedded Programming in C - Book-IIhandson28
 
Microprocessor and its applications third edition
Microprocessor and its applications third editionMicroprocessor and its applications third edition
Microprocessor and its applications third editionRizwan Ahmed
 
ADVANCED COMPUTER ARCHITECTURE PARALLELISM SCALABILITY PROGRAMMABILITY Baas ...
ADVANCED COMPUTER ARCHITECTURE PARALLELISM SCALABILITY PROGRAMMABILITY Baas  ...ADVANCED COMPUTER ARCHITECTURE PARALLELISM SCALABILITY PROGRAMMABILITY Baas  ...
ADVANCED COMPUTER ARCHITECTURE PARALLELISM SCALABILITY PROGRAMMABILITY Baas ...Angie Miller
 
Engineering Portfolio of Isaac Bettendorf
Engineering Portfolio of Isaac BettendorfEngineering Portfolio of Isaac Bettendorf
Engineering Portfolio of Isaac BettendorfIsaac Bettendorf
 
Microprocessor Trends.pptx
Microprocessor Trends.pptxMicroprocessor Trends.pptx
Microprocessor Trends.pptxFarshidHossain
 
Casp report
Casp reportCasp report
Casp reportqudhuqdh
 
Microcontroller based automatic engine locking system for drunken drivers
Microcontroller based automatic engine locking system for drunken driversMicrocontroller based automatic engine locking system for drunken drivers
Microcontroller based automatic engine locking system for drunken driversVinny Chweety
 
unit 1vlsi notes.pdf
unit 1vlsi notes.pdfunit 1vlsi notes.pdf
unit 1vlsi notes.pdfAcademicICECE
 
PLC: fabricación de PLC utilizando microcontroladores para uso didáctico con ...
PLC: fabricación de PLC utilizando microcontroladores para uso didáctico con ...PLC: fabricación de PLC utilizando microcontroladores para uso didáctico con ...
PLC: fabricación de PLC utilizando microcontroladores para uso didáctico con ...SANTIAGO PABLO ALBERTO
 
C10ComputerEngg.pptx
C10ComputerEngg.pptxC10ComputerEngg.pptx
C10ComputerEngg.pptxvijayapraba1
 

Similar to Embedded System -Lyla B Das.pdf (20)

Bharat gargi final project report
Bharat gargi final project reportBharat gargi final project report
Bharat gargi final project report
 
Report (2)
Report (2)Report (2)
Report (2)
 
cd-2-Batch id-33
cd-2-Batch id-33cd-2-Batch id-33
cd-2-Batch id-33
 
Book Preview: A Practical Introduction to the Xilinx Zynq-7000 Adaptive SoC
Book Preview: A Practical Introduction to the Xilinx Zynq-7000 Adaptive SoCBook Preview: A Practical Introduction to the Xilinx Zynq-7000 Adaptive SoC
Book Preview: A Practical Introduction to the Xilinx Zynq-7000 Adaptive SoC
 
Thesis_Final
Thesis_FinalThesis_Final
Thesis_Final
 
Maquina estado
Maquina estadoMaquina estado
Maquina estado
 
8051 Embedded Programming in C - Book-II
8051 Embedded Programming in C - Book-II8051 Embedded Programming in C - Book-II
8051 Embedded Programming in C - Book-II
 
Microprocessor and its applications third edition
Microprocessor and its applications third editionMicroprocessor and its applications third edition
Microprocessor and its applications third edition
 
ADVANCED COMPUTER ARCHITECTURE PARALLELISM SCALABILITY PROGRAMMABILITY Baas ...
ADVANCED COMPUTER ARCHITECTURE PARALLELISM SCALABILITY PROGRAMMABILITY Baas  ...ADVANCED COMPUTER ARCHITECTURE PARALLELISM SCALABILITY PROGRAMMABILITY Baas  ...
ADVANCED COMPUTER ARCHITECTURE PARALLELISM SCALABILITY PROGRAMMABILITY Baas ...
 
Engineering Portfolio of Isaac Bettendorf
Engineering Portfolio of Isaac BettendorfEngineering Portfolio of Isaac Bettendorf
Engineering Portfolio of Isaac Bettendorf
 
Microprocessor Trends.pptx
Microprocessor Trends.pptxMicroprocessor Trends.pptx
Microprocessor Trends.pptx
 
978 0-9766259-2-6 chap 2 excerpt
978 0-9766259-2-6 chap 2 excerpt978 0-9766259-2-6 chap 2 excerpt
978 0-9766259-2-6 chap 2 excerpt
 
Casp report
Casp reportCasp report
Casp report
 
Microcontroller based automatic engine locking system for drunken drivers
Microcontroller based automatic engine locking system for drunken driversMicrocontroller based automatic engine locking system for drunken drivers
Microcontroller based automatic engine locking system for drunken drivers
 
Brochure wc
Brochure wcBrochure wc
Brochure wc
 
Alcohol report
Alcohol reportAlcohol report
Alcohol report
 
unit 1vlsi notes.pdf
unit 1vlsi notes.pdfunit 1vlsi notes.pdf
unit 1vlsi notes.pdf
 
PLC: fabricación de PLC utilizando microcontroladores para uso didáctico con ...
PLC: fabricación de PLC utilizando microcontroladores para uso didáctico con ...PLC: fabricación de PLC utilizando microcontroladores para uso didáctico con ...
PLC: fabricación de PLC utilizando microcontroladores para uso didáctico con ...
 
C10ComputerEngg.pptx
C10ComputerEngg.pptxC10ComputerEngg.pptx
C10ComputerEngg.pptx
 
Ma
MaMa
Ma
 

Recently uploaded

Alambagh Call Girl 9548273370 , Call Girls Service Lucknow
Alambagh Call Girl 9548273370 , Call Girls Service LucknowAlambagh Call Girl 9548273370 , Call Girls Service Lucknow
Alambagh Call Girl 9548273370 , Call Girls Service Lucknowmakika9823
 
定制(USF学位证)旧金山大学毕业证成绩单原版一比一
定制(USF学位证)旧金山大学毕业证成绩单原版一比一定制(USF学位证)旧金山大学毕业证成绩单原版一比一
定制(USF学位证)旧金山大学毕业证成绩单原版一比一ss ss
 
定制(UI学位证)爱达荷大学毕业证成绩单原版一比一
定制(UI学位证)爱达荷大学毕业证成绩单原版一比一定制(UI学位证)爱达荷大学毕业证成绩单原版一比一
定制(UI学位证)爱达荷大学毕业证成绩单原版一比一ss ss
 
Call Girls in Nagpur Bhavna Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Bhavna Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Bhavna Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Bhavna Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
定制(Salford学位证)索尔福德大学毕业证成绩单原版一比一
定制(Salford学位证)索尔福德大学毕业证成绩单原版一比一定制(Salford学位证)索尔福德大学毕业证成绩单原版一比一
定制(Salford学位证)索尔福德大学毕业证成绩单原版一比一ss ss
 
Kalyan callg Girls, { 07738631006 } || Call Girl In Kalyan Women Seeking Men ...
Kalyan callg Girls, { 07738631006 } || Call Girl In Kalyan Women Seeking Men ...Kalyan callg Girls, { 07738631006 } || Call Girl In Kalyan Women Seeking Men ...
Kalyan callg Girls, { 07738631006 } || Call Girl In Kalyan Women Seeking Men ...Pooja Nehwal
 
Russian Call Girls Kolkata Chhaya 🤌 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls Kolkata Chhaya 🤌  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls Kolkata Chhaya 🤌  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls Kolkata Chhaya 🤌 8250192130 🚀 Vip Call Girls Kolkataanamikaraghav4
 
《1:1仿制麦克马斯特大学毕业证|订制麦克马斯特大学文凭》
《1:1仿制麦克马斯特大学毕业证|订制麦克马斯特大学文凭》《1:1仿制麦克马斯特大学毕业证|订制麦克马斯特大学文凭》
《1:1仿制麦克马斯特大学毕业证|订制麦克马斯特大学文凭》o8wvnojp
 
(办理学位证)韩国汉阳大学毕业证成绩单原版一比一
(办理学位证)韩国汉阳大学毕业证成绩单原版一比一(办理学位证)韩国汉阳大学毕业证成绩单原版一比一
(办理学位证)韩国汉阳大学毕业证成绩单原版一比一C SSS
 
Call Girls Service Kolkata Aishwarya 🤌 8250192130 🚀 Vip Call Girls Kolkata
Call Girls Service Kolkata Aishwarya 🤌  8250192130 🚀 Vip Call Girls KolkataCall Girls Service Kolkata Aishwarya 🤌  8250192130 🚀 Vip Call Girls Kolkata
Call Girls Service Kolkata Aishwarya 🤌 8250192130 🚀 Vip Call Girls Kolkataanamikaraghav4
 
Papular No 1 Online Istikhara Amil Baba Pakistan Amil Baba In Karachi Amil B...
Papular No 1 Online Istikhara Amil Baba Pakistan  Amil Baba In Karachi Amil B...Papular No 1 Online Istikhara Amil Baba Pakistan  Amil Baba In Karachi Amil B...
Papular No 1 Online Istikhara Amil Baba Pakistan Amil Baba In Karachi Amil B...Authentic No 1 Amil Baba In Pakistan
 
Vip Noida Escorts 9873940964 Greater Noida Escorts Service
Vip Noida Escorts 9873940964 Greater Noida Escorts ServiceVip Noida Escorts 9873940964 Greater Noida Escorts Service
Vip Noida Escorts 9873940964 Greater Noida Escorts Serviceankitnayak356677
 
Russian Call Girls In South Delhi Delhi 9711199012 💋✔💕😘 Independent Escorts D...
Russian Call Girls In South Delhi Delhi 9711199012 💋✔💕😘 Independent Escorts D...Russian Call Girls In South Delhi Delhi 9711199012 💋✔💕😘 Independent Escorts D...
Russian Call Girls In South Delhi Delhi 9711199012 💋✔💕😘 Independent Escorts D...nagunakhan
 
Beautiful Sapna Call Girls CP 9711199012 ☎ Call /Whatsapps
Beautiful Sapna Call Girls CP 9711199012 ☎ Call /WhatsappsBeautiful Sapna Call Girls CP 9711199012 ☎ Call /Whatsapps
Beautiful Sapna Call Girls CP 9711199012 ☎ Call /Whatsappssapnasaifi408
 
(办理学位证)加州州立大学北岭分校毕业证成绩单原版一比一
(办理学位证)加州州立大学北岭分校毕业证成绩单原版一比一(办理学位证)加州州立大学北岭分校毕业证成绩单原版一比一
(办理学位证)加州州立大学北岭分校毕业证成绩单原版一比一Fi sss
 
Gaya Call Girls #9907093804 Contact Number Escorts Service Gaya
Gaya Call Girls #9907093804 Contact Number Escorts Service GayaGaya Call Girls #9907093804 Contact Number Escorts Service Gaya
Gaya Call Girls #9907093804 Contact Number Escorts Service Gayasrsj9000
 
(SANA) Call Girls Landewadi ( 7001035870 ) HI-Fi Pune Escorts Service
(SANA) Call Girls Landewadi ( 7001035870 ) HI-Fi Pune Escorts Service(SANA) Call Girls Landewadi ( 7001035870 ) HI-Fi Pune Escorts Service
(SANA) Call Girls Landewadi ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
如何办理(UCLA毕业证书)加州大学洛杉矶分校毕业证成绩单留信学历认证原版一比一
如何办理(UCLA毕业证书)加州大学洛杉矶分校毕业证成绩单留信学历认证原版一比一如何办理(UCLA毕业证书)加州大学洛杉矶分校毕业证成绩单留信学历认证原版一比一
如何办理(UCLA毕业证书)加州大学洛杉矶分校毕业证成绩单留信学历认证原版一比一ga6c6bdl
 

Recently uploaded (20)

Alambagh Call Girl 9548273370 , Call Girls Service Lucknow
Alambagh Call Girl 9548273370 , Call Girls Service LucknowAlambagh Call Girl 9548273370 , Call Girls Service Lucknow
Alambagh Call Girl 9548273370 , Call Girls Service Lucknow
 
定制(USF学位证)旧金山大学毕业证成绩单原版一比一
定制(USF学位证)旧金山大学毕业证成绩单原版一比一定制(USF学位证)旧金山大学毕业证成绩单原版一比一
定制(USF学位证)旧金山大学毕业证成绩单原版一比一
 
定制(UI学位证)爱达荷大学毕业证成绩单原版一比一
定制(UI学位证)爱达荷大学毕业证成绩单原版一比一定制(UI学位证)爱达荷大学毕业证成绩单原版一比一
定制(UI学位证)爱达荷大学毕业证成绩单原版一比一
 
CIVIL ENGINEERING
CIVIL ENGINEERINGCIVIL ENGINEERING
CIVIL ENGINEERING
 
Call Girls in Nagpur Bhavna Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Bhavna Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Bhavna Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Bhavna Call 7001035870 Meet With Nagpur Escorts
 
Low rate Call girls in Delhi Justdial | 9953330565
Low rate Call girls in Delhi Justdial | 9953330565Low rate Call girls in Delhi Justdial | 9953330565
Low rate Call girls in Delhi Justdial | 9953330565
 
定制(Salford学位证)索尔福德大学毕业证成绩单原版一比一
定制(Salford学位证)索尔福德大学毕业证成绩单原版一比一定制(Salford学位证)索尔福德大学毕业证成绩单原版一比一
定制(Salford学位证)索尔福德大学毕业证成绩单原版一比一
 
Kalyan callg Girls, { 07738631006 } || Call Girl In Kalyan Women Seeking Men ...
Kalyan callg Girls, { 07738631006 } || Call Girl In Kalyan Women Seeking Men ...Kalyan callg Girls, { 07738631006 } || Call Girl In Kalyan Women Seeking Men ...
Kalyan callg Girls, { 07738631006 } || Call Girl In Kalyan Women Seeking Men ...
 
Russian Call Girls Kolkata Chhaya 🤌 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls Kolkata Chhaya 🤌  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls Kolkata Chhaya 🤌  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls Kolkata Chhaya 🤌 8250192130 🚀 Vip Call Girls Kolkata
 
《1:1仿制麦克马斯特大学毕业证|订制麦克马斯特大学文凭》
《1:1仿制麦克马斯特大学毕业证|订制麦克马斯特大学文凭》《1:1仿制麦克马斯特大学毕业证|订制麦克马斯特大学文凭》
《1:1仿制麦克马斯特大学毕业证|订制麦克马斯特大学文凭》
 
(办理学位证)韩国汉阳大学毕业证成绩单原版一比一
(办理学位证)韩国汉阳大学毕业证成绩单原版一比一(办理学位证)韩国汉阳大学毕业证成绩单原版一比一
(办理学位证)韩国汉阳大学毕业证成绩单原版一比一
 
Call Girls Service Kolkata Aishwarya 🤌 8250192130 🚀 Vip Call Girls Kolkata
Call Girls Service Kolkata Aishwarya 🤌  8250192130 🚀 Vip Call Girls KolkataCall Girls Service Kolkata Aishwarya 🤌  8250192130 🚀 Vip Call Girls Kolkata
Call Girls Service Kolkata Aishwarya 🤌 8250192130 🚀 Vip Call Girls Kolkata
 
Papular No 1 Online Istikhara Amil Baba Pakistan Amil Baba In Karachi Amil B...
Papular No 1 Online Istikhara Amil Baba Pakistan  Amil Baba In Karachi Amil B...Papular No 1 Online Istikhara Amil Baba Pakistan  Amil Baba In Karachi Amil B...
Papular No 1 Online Istikhara Amil Baba Pakistan Amil Baba In Karachi Amil B...
 
Vip Noida Escorts 9873940964 Greater Noida Escorts Service
Vip Noida Escorts 9873940964 Greater Noida Escorts ServiceVip Noida Escorts 9873940964 Greater Noida Escorts Service
Vip Noida Escorts 9873940964 Greater Noida Escorts Service
 
Russian Call Girls In South Delhi Delhi 9711199012 💋✔💕😘 Independent Escorts D...
Russian Call Girls In South Delhi Delhi 9711199012 💋✔💕😘 Independent Escorts D...Russian Call Girls In South Delhi Delhi 9711199012 💋✔💕😘 Independent Escorts D...
Russian Call Girls In South Delhi Delhi 9711199012 💋✔💕😘 Independent Escorts D...
 
Beautiful Sapna Call Girls CP 9711199012 ☎ Call /Whatsapps
Beautiful Sapna Call Girls CP 9711199012 ☎ Call /WhatsappsBeautiful Sapna Call Girls CP 9711199012 ☎ Call /Whatsapps
Beautiful Sapna Call Girls CP 9711199012 ☎ Call /Whatsapps
 
(办理学位证)加州州立大学北岭分校毕业证成绩单原版一比一
(办理学位证)加州州立大学北岭分校毕业证成绩单原版一比一(办理学位证)加州州立大学北岭分校毕业证成绩单原版一比一
(办理学位证)加州州立大学北岭分校毕业证成绩单原版一比一
 
Gaya Call Girls #9907093804 Contact Number Escorts Service Gaya
Gaya Call Girls #9907093804 Contact Number Escorts Service GayaGaya Call Girls #9907093804 Contact Number Escorts Service Gaya
Gaya Call Girls #9907093804 Contact Number Escorts Service Gaya
 
(SANA) Call Girls Landewadi ( 7001035870 ) HI-Fi Pune Escorts Service
(SANA) Call Girls Landewadi ( 7001035870 ) HI-Fi Pune Escorts Service(SANA) Call Girls Landewadi ( 7001035870 ) HI-Fi Pune Escorts Service
(SANA) Call Girls Landewadi ( 7001035870 ) HI-Fi Pune Escorts Service
 
如何办理(UCLA毕业证书)加州大学洛杉矶分校毕业证成绩单留信学历认证原版一比一
如何办理(UCLA毕业证书)加州大学洛杉矶分校毕业证成绩单留信学历认证原版一比一如何办理(UCLA毕业证书)加州大学洛杉矶分校毕业证成绩单留信学历认证原版一比一
如何办理(UCLA毕业证书)加州大学洛杉矶分校毕业证成绩单留信学历认证原版一比一
 

Embedded System -Lyla B Das.pdf

  • 1.
  • 3. The teacher, who is indeed wise, does not bid you to enter the house of his wisdom but rather leads you to the threshold of your mind. —Khalil Gibran A01_9788131787663_FM.indd ii A01_9788131787663_FM.indd ii 7/3/2012 4:16:58 PM 7/3/2012 4:16:58 PM
  • 4. EMBEDDEDSYSTEMS EMBEDDEDSYSTEMS LYLABDAS Department of Electronics and Communication Engineering National Institute of Technology Calicut Kozhikode, Kerala An Integrated Approach A01_9788131787663_FM.indd iii A01_9788131787663_FM.indd iii 7/3/2012 4:16:58 PM 7/3/2012 4:16:58 PM
  • 5. A01_9788131787663_FM.indd iv A01_9788131787663_FM.indd iv 7/3/2012 4:17:02 PM 7/3/2012 4:17:02 PM Copyright © 2013 Dorling Kindersley (India) Pvt. Ltd. Licensees of Pearson Education in South Asia No part of this eBook may be used or reproduced in any manner whatsoever without the publisher’s prior written consent. This eBook may or may not include all assets that were part of the print version. The publisher reserves the right to remove any material present in this eBook at any time. ISBN 9788131787663 eISBN 9789332511675 Head Office: A-8(A), Sector 62, Knowledge Boulevard, 7th Floor, NOIDA 201 309, India Registered Office: 11 Local Shopping Centre, Panchsheel Park, New Delhi 110 017, India
  • 6. This book is dedicated to my children and to all my students A01_9788131787663_FM.indd v A01_9788131787663_FM.indd v 7/3/2012 4:17:02 PM 7/3/2012 4:17:02 PM
  • 7. A01_9788131787663_FM.indd vi A01_9788131787663_FM.indd vi 7/3/2012 4:17:02 PM 7/3/2012 4:17:02 PM This page is intentionally left blank.
  • 8. vii Preface xiii About the Author xix Part I Design Aspects of Embedded Systems 1 0 Basics of Computer Architecture and the Binary Number System 3 0.1 Basics of Computer Architecture 3 0.2 Computer Languages 8 0.3 RISC and CISC Architectures 10 0.4 Number Systems 11 0.5 Number Format Conversions 13 0.6 Computer Arithmetic 21 0.7 Units of Memory Capacity 30 Key Points of this Chapter 31 Questions 31 Exercises 32 1 Introduction to Embedded Systems 34 1.1 Application Domain of Embedded Systems 35 1.2 Desirable Features and General Characteristics of Embedded Systems 35 1.3 Model of an Embedded System 37 1.4 Microprocessor vs Microcontroller 37 1.5 Example of a Simple Embedded System 40 1.6 Figures of Merit for an Embedded System 41 1.7 Classification of MCUs: 4/8/16/32 Bits 42 1.8 History of Embedded Systems 44 1.9 CurrentTrends 45 Key Points of this Chapter 45 Questions 46 Exercises 46 2 Embedded Systems—The Hardware Point of View 47 2.1 Microcontroller Unit (MCU) 48 2.2 A Popular 8-bit MCU 50 2.3 Memory for Embedded Systems 64 2.4 Low Power Design 78 2.5 Pullup and Pulldown Resistors 79 contents A01_9788131787663_FM.indd vii A01_9788131787663_FM.indd vii 7/3/2012 4:17:02 PM 7/3/2012 4:17:02 PM
  • 9. viii CONTENTS Key Points of this Chapter 84 Questions 85 Exercises 85 3 Sensors, ADCs and Actuators 86 3.1 Sensors 87 3.2 Analog to Digital Converters 97 3.3 Actuators 104 Key Points of this Chapter 130 Questions 131 Exercises 132 4 Examples of Embedded Systems 133 4.1 Mobile Phone 133 4.2 Automotive Electronics 139 4.3 Radio Frequency Identification (RFID) 143 4.4 Wireless Sensor Networks (WISENET) 145 4.5 Robotics 146 4.6 Biomedical Applications 150 4.7 Brain Machine Interface 151 Key Points of this Chapter 156 Questions 156 Exercises 157 5 Buses and Protocols 158 5.1 Defining Buses and Protocols 158 5.2 On-board Buses for Embedded Systems 166 5.3 External Buses 172 5.4 Automotive Buses 188 5.5 Wireless Communications Protocols 194 Key Points of this Chapter 202 Questions 203 Exercises 203 6 Software Development Tools 204 6.1 Embedded Program Development 204 6.2 Downloading the Hex File to the Non-volatile Memory 211 6.3 Hardware Simulator 215 Key Points of this Chapter 216 Questions 216 Exercises 217 Part II Software Design Aspects 219 7 Operating System Concepts 221 7.1 Embedded Operating Systems 223 7.2 Network Operating Systems (NOS) 223 A01_9788131787663_FM.indd viii A01_9788131787663_FM.indd viii 7/3/2012 4:17:02 PM 7/3/2012 4:17:02 PM
  • 10. CONTENTS ix 7.3 Layers of an Operating System 223 7.4 History of Operating Systems 224 7.5 Functions Performed by an OS (Components of an OS) 225 7.6 SomeTerms Associated with Operating Systems and Computer Usage 230 7.7 The Kernel 231 7.8 Tasks/Processes 234 7.9 Scheduling Algorithms 239 7.10 Threads 250 7.11 Interrrupt Handling 251 7.12 Inter Process (Task) Communications (IPC) 252 7.13 Task Synchronization 257 7.14 Semaphores 265 7.15 Priority Inversion 266 7.16 Device Drivers 268 7.17 Codes/Pseudo Codes for OS Functions 272 Key Points of this Chapter 287 Questions 287 Exercises 288 8 Real-time Operating Systems 290 8.1 Real-timeTasks 290 8.2 Real-time Systems 294 8.3 Types of Real-timeTasks 294 8.4 Real-time Operating Systems 296 8.5 Real-time Scheduling Algorithms 298 8.6 Rate Monotonic Algorithm 302 8.7 The Earliest Deadline First Algorithm 306 8.8 Qualities of a Good RTOS 308 Questions 309 Exercises 309 9 Programming in Embedded C 311 9.1 Embedded C 311 9.2 PIC Programming Using MPLAB 328 Key Points of this Chapter 331 Questions 331 Exercises 332 Part III Popular Microcontrollers Used in Embedded Systems 333 10 ARM—The World’s Most Popular 32-bit Embedded Processor (Part I – Architecture and Assembly Language Programming) 335 10.1 History of the ARM Processor 335 10.2 ARM Architecture 344 10.3 InterruptVectorTable 348 A01_9788131787663_FM.indd ix A01_9788131787663_FM.indd ix 7/3/2012 4:17:02 PM 7/3/2012 4:17:02 PM
  • 11. x CONTENTS 10.4 Programming the ARM Processor 349 10.5 ARM Assembly Language 349 10.6 ARM Instruction Set 352 10.7 Conditional Execution 356 10.8 Arithmetic Instructions 357 10.9 Logical Instructions 359 10.10 Compare Instructions 360 10.11 Multiplication 361 10.12 Division 362 10.13 Starting Assembly Language Programming 363 10.14 General Structure of an Assembly Language Line 364 10.15 Writing Assembly Programs 365 10.16 Branch Instructions 366 10.17 Loading Constants 370 10.18 Load and Store Instructions 375 10.19 Readonly and Read/Write Memory 381 10.20 Multiple Register Load and Store 382 Key Points of this Chapter 389 Questions 389 Exercises 390 11 ARM—The World’s Most Popular 32-bit Embedded Processor (Part II – Peripheral Programming of ARM MCU Using C) 391 11.1 Block Diagram 392 11.2 Features of the LPC 214x Family 393 11.3 Peripherals 397 11.4 ARM 9 424 11.5 ARM Cortex-M3 424 Key Points of this Chapter 427 Questions 428 Exercises 428 12 Cypress’s PSoC: A Different Kind of MCU 429 12.1 How to get a PSoC Development Kit 430 12.2 The PSoC Family 433 12.3 PSoC1 434 12.4 The Internal Architecture of PSoC 437 12.5 The Digital Sub System 443 12.6 GPIO Pins 453 12.7 Digital Applications Using PSoC 456 12.8 The Analog Section 463 12.9 System Resources 473 12.10 PSoC3 and PSoC5 476 Key Points of this Chapter 477 Questions 478 Exercises 479 A01_9788131787663_FM.indd x A01_9788131787663_FM.indd x 7/3/2012 4:17:02 PM 7/3/2012 4:17:02 PM
  • 12. CONTENTS xi 13 The 8051 Microcontroller: The Programmer’s Perspective 480 13.1 History and Family Details of 8051 480 13.2 8051:The Programmer’s Perspective 482 13.3 Assembly Language Programming 485 13.4 Internal RAM 491 13.5 The 8051 Stack 493 13.6 Processor StatusWord (PSW) 495 13.7 Assembler Directives 496 13.8 Storing Data in Code Memory (ROM) 497 13.9 The Instruction Set of 8051 499 13.10 Port Programming 514 13.11 Subroutines (Procedures) 520 13.12 Delay Loops 522 Key Points of this Chapter 527 Questions 527 Exercises 528 14 Programming the Peripherals of 8051 529 14.1 Pin Configuration of 8051 529 14.2 Programming the Internal Peripherals 533 14.3 Timers of 8051 535 14.4 Counter Programming 545 14.5 Interrupts of 8051 548 14.6 Serial Communication 558 Key Points of this Chapter 565 Questions 565 Exercises 566 15 DSP Processors 567 15.1 The Application Scenario 568 15.2 General Features of Digital Signal Processors 569 15.3 SIMDTechniques 581 15.4 The SHARC Floating Point Processor 587 15.5 DSP Processors ofTexas Instruments (TI) 590 15.6 OMAP (Open Multimedia Applications Platform) 592 Key Points of this Chapter 594 Questions 595 Exercises 595 Part IV Design and Performance Aspects 597 16 Automated Design of Digital ICs 599 16.1 History of Integrated Circuit (IC) Design 599 16.2 Types of Digital ICs 599 A01_9788131787663_FM.indd xi A01_9788131787663_FM.indd xi 7/3/2012 4:17:02 PM 7/3/2012 4:17:02 PM
  • 13. xii CONTENTS 16.3 ASIC Design 605 16.4 ASIC Design:The Complete Sequence 609 Key Points of this Chapter 612 Questions 612 Exercises 612 17 Hardware Software Co–design and Embedded Product Development Lifecycle Management 613 17.1 Hardware Software Co-design 614 17.2 Modelling of Systems 616 17.3 Embedded Product Development Lifecycle Management 620 17.4 Lifecycle Models 626 Key Points of this Chapter 629 Questions 629 Exercises 629 18 Embedded Design: A Systems Perspective 630 18.1 ATypical Example 631 18.2 Product Design 633 18.3 The Design Process 637 18.4 Testing 654 18.5 Bulk Manufacturing 655 Key Points of this Chapter 657 Questions 657 Exercises 658 Part V Projects 659 19 Academic Projects 661 19.1 Project No: 1 661 19.2 Project No: 2 675 19.3 Project No: 3 683 Key Points of this Chapter 693 Questions 693 Exercises 694 Appendix A 695 Appendix B 700 Appendix C 710 Appendix D 729 Bibliography 741 Index 745 A01_9788131787663_FM.indd xii A01_9788131787663_FM.indd xii 7/3/2012 4:17:02 PM 7/3/2012 4:17:02 PM
  • 14. xiii Preamble Writing a book on Embedded Systems is not easy—let me list a few reasons to substantiate this statement. The first reason is that the field of embedded systems is very vast. The second is that there is no clear understanding on what exactly a student of engineering should learn about embedded systems.A great number of products which are classed as embedded systems are available,and the field is very sophisticated, well developed and rapidly expanding. Anything from a printer to an iPhone is an embedded system.To write a book on all this is quite difficult on account of not having a clear idea of where to start and where to end. To complicate matters further, there are different families of embedded processors. A student cannot be expected to learn all of them, or even some of them. To make a decision on what to include and what not to, has been difficult, Besides that, ‘embedded processors’ is not the only topic to learn. There is a large set of various kinds of sensors, actuators, buses, operating systems, design methodologies, view points, development models and what not. But after a lot of contemplation, finally, I converged on a few popular and upcoming processors, latest buses,new approaches,traditional as well as modern peripherals,real time operating systems and the like. A lot of literature for all these is available in the form of technical documents, data sheets and user manuals—right from the USB technical spec to PSoC’s data sheets Rummaging through all these highly sophisticated technical information,trying to make sense of it all, and finally presenting it in a way that a student, albeit an eager and enthusiastic one, will be able to enjoy reading and studying it—this is the challenge involved in writing this book. I have tried my best to address this challenge of making it a student-friendly presentation. There are a number of books available under the title of ‘Embedded Systems’. Except for a few, most of them have simply concentrated on the architecture and application details of one particular processor. Others have concentrated on the software aspects alone. There are certain others that deal with both,but since the field of embedded systems is one in which fast evolution is the rule rather than the exception, some topics become outdated quite fast. Approach I have started from the hardware basics, proceeded to discuss some important processors and systems, and then moved on to the software aspects. The book ends with a presentation on embedded design from a system point of view. Along with the basics, I have also tried to focus on the latest and most relevant topics in the field, from the latest processors and buses to the latest trends in embedded computing. Pre-requisite A student of CS, EC or EE branch who has done a first course in digital logic and a second course in ‘microprocessors and microcontrollers’, is best placed to take up a course on Embedded Systems. preface A01_9788131787663_FM.indd xiii A01_9788131787663_FM.indd xiii 7/3/2012 4:17:02 PM 7/3/2012 4:17:02 PM
  • 15. xiv PREFACE But it is possible also to study Embedded Systems as a second course—that is why some very basic ideas of microprocessors and microcontrollers are included in the initial chapters. Organization of the Book This book is organized as twenty chapters numbered from 0 to 19. It is divided into five logical parts from Part I to Part V. Part I This part, which includes chapters 0 to 6, deals with the basics, the hardware aspects including sensors, actuators, buses etc. and the tools commonly used in system development. Chapter 0 is a revision of computer arithmetic and computer architecture. One needs to be very thorough in these two basic topics—then the path ahead becomes very comfortable. Chapter 1 introduces readers to what an embedded system is, and what its mandatory parts are. Examples of practical and popularly used embedded systems are listed to make the introduction clear. The classifications, history and current trends in the embedded industry are also touched upon. Chapter 2 is a very important chapter—any student who needs to use/learn embedded hardware should become conversant and confident about all the topics covered in this chapter.Not only are the important aspects of typical embedded processors covered here, related topics such as semiconductor memory (RAM and Flash),low power design,con- cepts of pullup and pulldown resistors are also touched upon. Chapter 3 is very important for practical design of systems. Most students are likely to do hardware based projects as part of academic requirements—this chapter, which gives an in-depth discussion on sensors and actuators will definitely find use then. Chapter 4 is meant for a light reading on some of the applications of embedded systems. Mobile phones, robotics, RFIDs, automotive electronics, medical electronics etc. are discussed as popular applications. A new idea called ‘brain machine interface’ is also introduced in this chapter. Chapter 5 is meant to be studied as a very important topic. It contains explanations of some of the popular buses used in embedded systems. A student is not expected to study all buses in detail, but a general idea of buses, and a study of some of the important ones is advised. On-board and off-board buses, wired and wireless buses, bus standards, bus arbitration etc are the important topics covered here. Chapter 6 is a brief introduction to the development tools that are needed to take a proj- ect to completion.The discussion is meant to guide students in the right direction when they are confused about the techniques for writing programs, testing them and burning them into hardware. A01_9788131787663_FM.indd xiv A01_9788131787663_FM.indd xiv 7/3/2012 4:17:02 PM 7/3/2012 4:17:02 PM
  • 16. PREFACE xv Part II This is the second part of the book,and there are three chapters here.This part deals with software design aspects. Chapter 7 is quite lengthy, but it should mandatorily be learned because it gives answers to many aspects of computers and embedded systems that are seen and experienced in everyday life. This chapter covers operating system concepts in detail and then offers codes/pseudo codes where OS concepts are tried out. Chapter 8 is about ‘real time operating systems’.This should be considered as a continu- ation of the previous chapter, But here the special requirements and scheduling policies for a special class of embedded systems i.e., real time systems, are taken up. Numerical problems are worked in both these chapters to understand the scheduling mechanism used in operating systems. Chapter 9 is a short chapter, being at best a basic introduction to Embedded C. It assumes that the reader has a basic knowledge of the constructs of ‘C’. How this high- level language is used for processor programming is the focus of the discussion, which is based on the 8051 architecture. Some codes for PIC are also included. Later chapters of PSoC and ARM contain more coding using Embedded C, but basic ideas are intro- duced here, in Chapter 9. Part III This part consists of Chapter 10 to Chapter 15. The architecture, programming and applications of some of the most widely used and popular processors are covered in reasonable depth. Chapters 10 and 11 are devoted to the ARM processor, which is the most popular pro- cessor used in 32-bit and high-end applications. Chapter 10 explains the core of ARM and follows it up with assembly language programming. Chapter 11 expands ARM architecture to make it a microcontroller. A specific ARM-based MCU is chosen and its peripherals are studied. Programming of some peripherals using C is done.These two chapters are likely to be sufficient to get a good grip on ARM architecture. Chapter 12 is about a new processor. It is not new in the embedded design world, but the academic world is just getting familiarized with it – the chapter discusses PSoC, an MCU series, which makes life easier for a product designer. This is because of the graphical IDE it has, and other special features that are covered (with programming examples in Embedded C) in the chapter. Chapters 13 and 14 are about one of the most widely used 8-bit microcontroller i.e., the 8051. This MCU is simple and the first that a student should study. These two chapters discusses this MCU with assembly language programming. All the peripherals are cov- ered, and programming is explained with worked-out examples. Chapter 15 contains a general coverage of DSP processors. Such processors are increas- ing in relevance and the time is just right to learn the special features of such chips. The special features of such processors are first explained, and then some popular DSP processors (BlackFin, SHARC, OMAP etc) have been identified, and their features elaborated. A01_9788131787663_FM.indd xv A01_9788131787663_FM.indd xv 7/3/2012 4:17:02 PM 7/3/2012 4:17:02 PM
  • 17. xvi PREFACE Part IV This part includes Chapters 16, 17 and 18. Chapter 16 deals with ASIC design. It starts with the classification of digital ICs, continues with programmable devices and then gives a step-by-step explanation of how a digital IC is designed, tested and fabricated. The reader can get a good idea of what terms such as front-end design,back-end design etc.mean,without going very deep into the process of ASIC design. Chapter 17 introduces two new terminology.One is ‘Hardware Software Co-design’and the other is ‘Embedded Product Development Lifecycle’.Both these terms are explained and elaborated upon, with relevant examples. Chapter 18 is very special. After all the previous chapters, it looks upon an embedded product as a system, and suggests the steps needed to apply embedded systems to make useful products as demanded by users. The user/users might have their viewpoint expressed before the design starts. New concepts like user research, ergonomics, anthro- pometry etc are introduced. Starting from the desires of users, the design steps reach the final stage of product manufacture and resting. Part V This part has just one chapter. Chapter 19 has a concise discussion of three projects done by students.The projects pertain to embedded hardware and software and use advanced processors—ARM, OMAP and PIC. This chapter is meant to encourage students to take up challenging and innovative ideas and build products based on these ideas. Appendices The book has appendices from A to K. Only Appendix A to D are in the text book, The rest are available in the website of the book www.pearsoned.co.in/lylabdas/ embeddedsystems. The contents of the appendices are as listed: A - The instruction set of 8051 B - A step-by-step guide to using the Keil RVDK for 8051 and ARM C - A step-by-step guide to using the PSoC Designer D - Pin configuration and PINSEL register configuration of LPC 2148 E - A manual with experiments for PSoC1 F - A step by step guide to using PSoC Creator G - A tutorial on Keil RVDK for 8051 and ARM H - A program for interfacing a Graphical LCD to PSoC3 I - A program for interfacing an SD card to ARM7 (LPC 2148) J - A program for using the I2HC interface of PSoC1 K - User manual of ARM LPC 2148 In addition, PowerPoint presentations and solution manual of the chapters are available for instructors. A01_9788131787663_FM.indd xvi A01_9788131787663_FM.indd xvi 7/3/2012 4:17:02 PM 7/3/2012 4:17:02 PM
  • 18. PREFACE xvii Contact Your suggestions and feedback are welcome. In spite of my best efforts, it is possible that some errors may have crept in. Please point them out to me. My contact id is lbd@nitc.ac.in ACKNOWLEDGEMENTS This is my second major book,and as I complete it,I would like to acknowledge all those who have helped and encouraged me in this Herculean task. Truly, it has been a great effort to write it, and there are a lot of people who have directly or indirectly helped me. Let me start from the beginning. The team at Pearson Education provided a lot of inputs, suggestions and support and brought the project to fruition. I feel that Sojan Jose, my editor, and Ramesh M. R and Vijay Pritha, the production editors have done a tremendous job. The first batch of students I taught Embedded Systems was the B070EC batch and the next year, the B080EC batch came in. Both batches expressed enthusiasm and interest in the topics I taught, and this is the primary factor that gave me the courage to embark on the venture of writing a book on the subject. I would like to thank each and every one of them for this. During the process of writing,a few students helped me directly in bringing the book to this form. They gave suggestions, performed reviews, and three of them have contrib- uted by writing a few sections of the book. All of them are working in reputed companies and I would like to list their names, along with expressing my heartfelt thanks to them. Nithin Gopinath (Texas Instruments, Bangalore), Sabu Paul (Texas Instruments, Bangalore) and Sai Krishna K. (Broadcom, Bangalore) are the three who have contrib- uted directly by writing a few sections in the book. The list of those who have done reviews of the chapters are: Nithin Gopinath (Texas Instruments, Bangalore), Jayalal Vijayan (Synopsis, Bangalore), Sai Krishna K. (Broadcom, Bangalore), Harikrishnan M. (McAfee, Bangalore), Srijit R. (Deloitte, Hyderabad) and Sushmitha Dandeliya (Assistant Professor, Engineering College, Gwalior). A few of my colleagues also have helped me in this endeavor, and I extend my gratitude to them. Raghu C. V., my colleague in the department, has done the writing of Chapter 18, and has also given me suggestions at various stages of this work. The names of others with whom I have had discussions on some topics are Sameer S. M., Deepthi P. P., Sudheesh George, Bhuvan B. and Rajiv T. R., my department colleagues, and Jayaraj B.and Anu Mary Chacko of the Computer Science Department.I am grate- ful to Anand, senior mechanic at the Embedded Systems Lab, who assisted me in all the hardware work associated with the book. I thank Beljit, Anju and Aswathi who have drawn the diagrams in the book. I would also like to make a note of acknowledgement to my son Sagar, for his suggestions on the theme of the front cover of the book. Two engineers at Cypress Semiconductors, Narayana Swamy, and Geethesh N. S., made a detailed review of the chapter on PSoC.Their inputs have enhanced the quality of the chapter. I am obliged to them and also to Benoy Jose, and Karthikeyan Mahalingam of Cypress Semiconductors for co-ordinating this activity. A01_9788131787663_FM.indd xvii A01_9788131787663_FM.indd xvii 7/3/2012 4:17:03 PM 7/3/2012 4:17:03 PM
  • 19. xviii PREFACE It is only because my department gave me free time without the hassles of regular work that I have been able to complete the book on schedule. All my colleagues have been helpful in this and I feel that words are not sufficient to express my feelings of gratitude to all of them. I am deeply indebted to my institute for giving me the freedom to grow and follow the path I chose. Chapter 19 of the book contains the project work of a few teams of students. They have worked systematically and enthusiastically to do projects of good standard, which require a lot of background study. I congratulate them for the work they have done and would like to mention their names here. They are: Nithin Gopinath, Jayalal Vijayan, Ashwin Harikumar, Kurian Abraham, Ebin George, Sushmita Dandeliya, Fahim Bin Basheer, Jinu J. Alias, Mohammed Favas C., Navas V. and Naveed Farhan K. I am happy that my family has always been a source of solace for me. Last, but not the least, I thank all my students once again for the inspiration they have always been, and continue to be. LYLA B. DAS A01_9788131787663_FM.indd xviii A01_9788131787663_FM.indd xviii 7/3/2012 4:17:03 PM 7/3/2012 4:17:03 PM
  • 20. xix about the author Lyla B. Das is Associate Professor, Department of Electronics Engineering, National Institute of Technology Calicut (NITC), Kerala. She has a diverse mix of industrial, teaching and research experi- ence spanning about 30 years. As a young graduate specializing in Electronics and Communications from the College of Engineering, Trivandrum, Lyla B. Das joined Keltron Controls as Deputy Engineer in 1981.She joined NITC (then Regional Engineering College,Calicut),as lecturer in 1985 and proceeded to complete her master’s degree in digital communications from the same college.Over the years, she was successively elevated as Assistant Professor and then Associate Professor, a position which she currently holds. Keen to actively seek and impart knowledge, Lyla B. Das currently teaches courses on micro- processors, microcontrollers, digital system design using VHDL, and system design using embed- ded processors at the undergraduate as well as postgraduate level. She has presented research papers in conferences of national and international stature and has worked on numerous projects based on microprocessors and microcontrollers, such as microprocessor-based voting machines and microcontroller-based rail track switching system. An avid reader of contemporary research material, she keeps herself abreast of the current trends in her chosen field and guides students in their M.Tech. research theses. This book on Embedded Systems is her second book with Pearson Education, the first one being The X86 Microprocessors, which was published in 2010 and received with wide acclaim. Lyla B. Das has worked on various projects funded by the ministry of human resource develop- ment (MHRD) in thrust areas of growth including the setting up of an embedded systems labora- tory in 2005–2008. She has delivered expert lectures on image compression using wavelets, advanced microprocessors and microcontrollers, FPGA based systems and embedded systems at several engi- neering colleges across Kerala. She has also participated in numerous tutorials and workshops con- ducted by the Indian Institute of Technology (IIT) and the Indian Institute of Science (IISc).She was a Fellow in the national conference on ‘VLSI Design and Embedded Systems’held at IISc Bangalore (2003) and IIT Mumbai (2004). She is a life member of the System Society of India and a member of the Indian Society for Technical Education and the Computer Society of India. A01_9788131787663_FM.indd xix A01_9788131787663_FM.indd xix 7/3/2012 4:17:03 PM 7/3/2012 4:17:03 PM
  • 21. A01_9788131787663_FM.indd xx A01_9788131787663_FM.indd xx 7/3/2012 4:17:03 PM 7/3/2012 4:17:03 PM This page is intentionally left blank.
  • 22. PART-I DESIGN ASPECTS OF EMBEDDED SYSTEMS M00_9788131787663_C00.indd 1 M00_9788131787663_C00.indd 1 7/3/2012 12:08:16 PM 7/3/2012 12:08:16 PM
  • 23. M00_9788131787663_C00.indd 2 M00_9788131787663_C00.indd 2 7/3/2012 12:08:16 PM 7/3/2012 12:08:16 PM This page is intentionally left blank.
  • 24. 0.1 | Basics of Computer Architecture 0.1.1 | The Block Diagram of a Computer A computer, as its name indicates is a machine used for computing. Computing, which many years ago meant arithmetic calculations, has now given way to large amounts of ‘data processing’. As such, it is more reasonable to designate the computer now as a ‘data processing machine’. For performing its designated tasks, this machine requires many components, which can broadly be divided as hardware and software. Hardware is obvi- ously, the physical constituents of a computer. Software is the collection of programs which directs the hardware to perform its tasks. Let us first look at a computer in terms of its hardware. Figure 0.1 shows the archi- tectural description of a computer system. It shows the major parts of the computer and also indicates how these parts are connected together, to form the computing machine. The major parts are the CPU, memory and input/output devices. The heart of a computer is the ‘central processing unit’. It is this unit which gives ‘life’to a computer.The CPU usually is a ‘microprocessor’, which means that it is usually a separate and self contained chip. The CPU processes the data given to it, according to the programs meant to operate on these data. The program consists of ‘instructions’. These instructions are decoded by the CPU, which generates control signals necessary In this chapter, you will learn The general principles of computer archi- tecture The operation of the data,address and con- trol buses of a computer The distinction between RISC and CISC computing The comparison between assembly and high level language programming The binary, hexadecimal and BCD number systems Number format conversions basics of computer architecture and the binary number system 0 Chapter-opening image: Firebird robotic platform (Courtesy: Nex Robotics, Mumbai). M00_9788131787663_C00.indd 3 M00_9788131787663_C00.indd 3 7/3/2012 12:08:16 PM 7/3/2012 12:08:16 PM
  • 25. 4 EMBEDDED SYSTEMS to activate the arithmetic and logic units of the CPU. As such, the CPU contains the arithmetic logic unit and the control unit.All these activities are timed and synchronized by a pulse train of fixed frequency.This is the clock signal, and it also has the job of syn- chronizing the activity of the CPU with the activity on the bus. 0.1.2 | The System Bus A bus is collection of signal wires which connect between the components of the com- puter systems—Figure 0.2 shows that the CPU is connected to the memory as well as I/O through the system bus,but only one at a time—if the memory and I/O wants to use the bus at the same time, there is a conflict, as there is only one system bus. The system bus comprises of the address bus, data bus and the control bus. The Data Bus The set of lines used to transfer data is called the data bus. It is a bidi- rectional bus, as data has to be sent from the CPU to memory and I/O, and has to be received as well by the CPU.The width of the data bus determines the data transfer rate, size of the internal registers of the CPU and the processing capability of the CPU. In short, it is a reflection of the complexity of the processor. As we see, the 8086 has a data bus width of 16 bits, while the 80486 has a 32-bit bus width.Thus the 80486 can process data of 32 bits at a time while the 8086 can only handle 16 bits. The Address Bus The address bus width determines the maximum size of the physi- cal memory that the CPU can access. With an address bus width of 20 bits, the 8086 can address 220 different locations. It can use a memory size of 220 bytes or 1 MB. For Pentium with an address bus width of 32 bits, the corresponding numbers are 232 bytes i.e., 4 GB. When a particular memory location is to be accessed, the corresponding address is placed on the address bus by the CPU. I/O devices also have addresses. In both cases, it is the CPU which supplies the address, and as such, the address bus is unidirectional. The Control Bus The control bus is a set of control signals which needs to be activated for activities like writing/reading to/from memory/I/O, or special activities of the CPU like interrupts and DMA. Thus, we see signals like Memory Read, I/O Read, Memory Write and Interrupt Acknowledge as part of the control bus.These control signals dictate Figure 0.1 | The block diagram of a computer CPU Memory I/O M00_9788131787663_C00.indd 4 M00_9788131787663_C00.indd 4 7/3/2012 12:08:17 PM 7/3/2012 12:08:17 PM
  • 26. BASICS OF COMPUTER ARCHITECTURE AND THE BINARY NUMBER SYSTEM 5 the actions taking place on the system bus that involve communications with devices like memory or I/O. For example, the Memory Read signal will be asserted for reading from memory. It is sent to memory from the processor. A signal such as ‘Interrupt’is received by the processor from an I/O device. Hence in the control bus, we have signals traveling in either direction. Some control lines may be bidirectional too. Now that we have discussed a computer system in general,let us go a bit deeper into its individual constituents. 0.1.3 | The Processor The processor or the microprocessor as we might call it,is the component responsible for controlling all the activity in the system.It performs the following three actions continu- ously. See Figure 0.3. i) Fetch an instruction from memory. ii) Decode the instruction. iii) Execute the instruction. When we write a program, it is stored in memory. Our code has to be brought to the processor for the required action to be performed. The first step obviously, is to ‘fetch’ it from memory. The next step i.e., decoding, involves the interpretation of the code as to what action is to be performed. After decoding, the action required is performed. This is termed ‘instruction execution’. The sequence of these three actions is called the ‘execution cycle’. To do all this, the processor has ‘control circuitry’ to fetch and decode instructions. The ALU part of the processor performs the required arithmetic/logic Figure 0.2 | The system bus and its components Address Bus Data Bus Control Bus I/O Device I/O Device I/O Device Processor Memory I/O Interface M00_9788131787663_C00.indd 5 M00_9788131787663_C00.indd 5 7/3/2012 12:08:17 PM 7/3/2012 12:08:17 PM
  • 27. 6 EMBEDDED SYSTEMS operations. The sequence of fetch-decode-execute is done continuously and infinitely by the processor. An important implication of this cycle is that instruction execution is ‘sequential’ in nature—it is only after the first instruction is dealt with, will the second one be taken up.However,there will be situations when the sequential nature of program execution is disturbed.This is when a ‘branch’ instruction appears in the sequence, and a new sequence of instructions will be taken up starting from a new location. 0.1.4 | System Clock All the activities of the processor and buses are synchronized by a clock, which is as shown in Figure 0.4 a square wave with a particular frequency. The reciprocal of the clock frequency is the cycle time T, also called the clock period. T = 1/f where f is the clock frequency. An execution cycle may require many clock periods. This depends on the architectural features of the processor, as well as the complexity of the instruction to be executed. Since an execution cycle also involves fetching instructions and data from memory, it also depends on how many clock cycles are needed to access memory. Obviously, the time for execution depends on the clock speed as well. i.e., a clock speed of 3 GHz implies faster processing than a clock of 1 GHz. However, the technology used for the processor must be able to support the clock frequency used. 0.1.5 | Memory The memory associated with a computer system includes the primary memory as well as secondary memory. However, for the time being, we will think of memory as con- stituting the primary or main memory only, which is usually RAM (Random Access F D E F D E F Execution Cycle F -Fetch D -Decode E-Execute Execution Cycle Figure 0.3 | The execution cycle Figure 0.4 | System clock 1 0 Clock Cycle Time M00_9788131787663_C00.indd 6 M00_9788131787663_C00.indd 6 7/3/2012 12:08:17 PM 7/3/2012 12:08:17 PM
  • 28. BASICS OF COMPUTER ARCHITECTURE AND THE BINARY NUMBER SYSTEM 7 Memory). Memory is organized as bytes, and the capacity of a memory chip is stated in terms of the number of bytes it can store.Thus, we can have chips of size 256 bytes, 1KB, 1MB and so on.If a computer has a total memory space of 20 MB it can use RAM chips of the available capacity to get that much of memory. There are two basic operations associated with memory—read and write. Reading causes a data stored in a memory location to be transferred to the CPU, without erasing the content in memory. Writing causes a new data to be placed in a memory location (it overwrites the previous value). There is a certain amount of time required for these operations and this is termed as ‘access time’. Memory Read Cycle The steps involved in a typical read cycle are: i) Place on the address bus, the address of the memory location whose content is to be read.This action is performed by the processor. ii) Assert the memory read signal which is part of the control bus. iii) Wait until the content of the addressed location appears on the data bus. iv) Transfer the data on the data bus to the processor. v) De-activate the memory read signal. The memory read operation is over and the address on the address bus is not relevant anymore. Memory Write Cycle As a continuation, let us also examine the steps in a typical write cycle. i) Place on the address bus, the address of the location to which data is to be written. ii) On the data bus, place the data to be written. iii) Assert the memory write signal which is part of the control bus. iv) Wait until the data is stored in the addressed location. v) De-activate the memory write signal.This ends the memory write operation. At this stage, we should remember that these operations are synchronized with the sys- tem clock. An 8086 processor takes at least four clock cycles for reading/writing. These four cycles constitute the ‘memory read’ and ‘memory write’ cycles for the processor. Other processors may require more/less clock cycles for the same operations. 0.1.6 | The I/O System For a computer to communicate with the outside world there is the need for what are called peripherals. Some of these peripherals are purely input devices like the keyboard and mouse; some are purely output devices like the printer and video monitor and some Figure 0.5 | Memory and associated control signals Memory Address Read Write Data M00_9788131787663_C00.indd 7 M00_9788131787663_C00.indd 7 7/3/2012 12:08:17 PM 7/3/2012 12:08:17 PM
  • 29. 8 EMBEDDED SYSTEMS like the modem transfer data in both directions.All this just means that such I/O devices are needed for us to use a computer.However,it is difficult for a processor to deal directly with I/O devices, because of their incompatibility with the processor—each peripheral is different and the operating conditions, voltages, speeds and standards are not under- standable to the processor. The processor does not have the necessary control signals to deal with different peripherals. Hence, the normal practice is for each peripheral to have a controller which acts as an interface between the peripheral and the processor. This controller, which may be a special purpose chip, understands the characteristics of the particular device and provides the necessary control signals to the processor to communi- cate with the peripheral.Thus, we have specialized controllers for most peripherals—like the keyboard display interfacing chip, parallel port interfacing chip and serial communi- cation chip. All these chips are programmable—they have registers for commands, data and status. By suitably programming these chips, we can get the processor to communi- cate correctly with any peripheral. Figure 0.6 shows the use of an I/O interface between an I/O device and a processor. The processor is not shown in the figure, but the system bus which comes from the processor is shown. In the final analysis, we can think of a computer that we usually use, as a conglom- eration of components which include memory and I/O devices of various types, applica- tions and specifications. 0.2 | Computer Languages 0.2.1 | Machine Language, Assembly Language and High Level Language The computer is just a dumb piece of equipment unless we are able to make it work for us. For that, we must be able to ‘program’it, so that it will perform the tasks we assign it. Programming a computer entails the use of a language that the computer understands. The language native to computers is ‘machine language’ which consists of binary ones and zeros. The computer knows this language, and the series of ones and zeros fed to it Data Status Command I/O Interface Address Bus Data Bus Control Bus System Bus I/O Device Figure 0.6 | The I/O system M00_9788131787663_C00.indd 8 M00_9788131787663_C00.indd 8 7/3/2012 12:08:17 PM 7/3/2012 12:08:17 PM
  • 30. BASICS OF COMPUTER ARCHITECTURE AND THE BINARY NUMBER SYSTEM 9 are ‘operation codes’ for it, which tells it what action is to be performed. Thus there is one binary code for addition and another one for subtraction.These operation codes are called ‘opcodes’and this language is called ‘machine language’. Programming in machine language means writing the opcodes of the tasks we want to get done by the computer. However, the problem with machine language, as is obvious, is that it is cumbersome and error-prone. Human beings are not good at remembering or using binary codes. Programming using machine language is not something that any one of us is likely to enjoy. To make it easier for us to communicate with computers, there is a language at a slightly higher level and that is called ‘assembly language’. This is more intelligible to users than machine code.This language uses ‘mnemonics’for specifying the operation the computer is to perform.These mnemonics are a direct translation of the machine code to a symbol.For example,the binary code for addition is replaced by the symbol ‘ADD’—the binary code for multiplication is given the symbolic name ‘MUL’. The exact mnemonic used depends on the processor type, but it will be related to the operation to be done. How does this help? A user does not have to remember binary codes or enter binary code for programming. He only needs to remember the symbolic codes and the asso- ciated syntax. We say that assembly coding is at a higher level than machine coding. However, does the computer understand the mnemonics? No, which means that should be an interface between assembly language and machine language. This interface con- verts the symbolic codes fed in by the user into machine codes.The software which does this is called an ‘assembler’. Since machine language is native to a processor, each processor will have its own machine language and thus it has its own assembly language also. Translating from assembly language to machine language and vice versa is a one to one process—one opcode translates to a unique machine code for a particular processor. However, we human beings always look for easier ways to get things done. So there are ‘higher level languages’ which has the vocabulary and grammar similar to the lan- guage spoken by us.Such languages are very easy to use because the communication pro- cess is similar to English.We have heard of languages like C,FORTRAN,COBOL and many, many such ‘high level languages’.The features of such languages are that they are i) easy to understand and write, ii) are not processor specific. Thus if we write a program in C, we can use it to run on any processor—as long as the ‘compiler’ for the language is available. The compiler is the software which ‘translates the high level language statements’to statements in a lower level language.The lower level may be assembly or machine language. However, finally the processor needs the machine code. The program that we write in assembly or high level language is called the source program or source code.A compiler or assembler converts this into an object code which is ‘executable’ in the sense that the processor understands the code and performs the tasks indicated. 0.2.2 | Comparison Programming in machine language is too cumbersome and hence ruled out in the pres- ent world. However, assembly language programming is frequently done, so let us now M00_9788131787663_C00.indd 9 M00_9788131787663_C00.indd 9 7/3/2012 12:08:18 PM 7/3/2012 12:08:18 PM
  • 31. 10 EMBEDDED SYSTEMS make a comparison between assembly language programming and high level language programming. Assembly code is specific to a processor—which means that the assembly code of 8086 does not make any sense to 8085 (though both are Intel made).Assembly programs need the programmer to know the architecture of the processor intimately. He should know the registers and flags and the way each instruction handles data.So doing assembly coding involves the study of the concerned processor. However, once this part is done, coding is very efficient, compact and executes very fast. Speed advantage of a hundred times or more,is fairly common.Assembly language programming also gives direct access to key machine features essential for implementing certain kinds of low level routines, such as an operating system kernel or microkernel, device drivers, and machine control. High level language programming, on the other hand, is not processor-specific. It is easy to learn and master. However, high level languages are abstract.Typically a single high level instruction is translated into several (sometimes dozens or in rare cases even hundreds) executable machine language instructions. The object code generated by a compiler is usually not compact. However, the advantage of high level languages is that since it is easy to learn, semi-skilled designers can be employed for development activi- ties, and so development and maintenance times are much less. This book focuses on the x86 architecture and on assembly language programming. The aim is to impart good assembly language skills and a thorough knowledge of the x86 architecture. 0.3 | RISC and CISC Architectures Two terms that are likely to be encountered frequently while reading about computer architecture are RISC and CISC. RISC stands for Reduced Instruction Set Computer and CISC means Complex Instruction Set Computer. Since a lot of controversy sur- rounds these two terms, let us try to find out what it is all about. In the early days of microprocessor development, the trend was to have complex instructions implemented fully using hardware. For example, the multiply instruction is a complex instruction which needs a dedicated hardware multiplier. Because hardware is fast, execution is fast, but with lots of such complex instructions, the hardware budget is naturally high.This is the philosophy and the main feature of CISC. RISC on the other hand, views this matter in a different way. On an average, the number of complex instructions a computer uses is relatively less. So, why not realize a complex instruction using a set of simple instructions? This is possible, and the advan- tage is that the hardware budget is much less.The instruction set is also small. However, software is to be written to realize complex instructions with simple instructions. This amounts to trading software for hardware. There exists a long history of controversy regarding which is better. The x86 archi- tecture was based on the CISC philosophy, right from the beginning. By the time RISC principles became popular and software development for RISC became established, the x86 CISC processors had already carved a niche for themselves in the processor market. So,even though the supporters of RISC were able to establish their point,most develop- ers did not want to take the risk of switching over to an untested domain.However,most of the newer processors used the RISC philosophy for their architectures—examples M00_9788131787663_C00.indd 10 M00_9788131787663_C00.indd 10 7/3/2012 12:08:18 PM 7/3/2012 12:08:18 PM
  • 32. BASICS OF COMPUTER ARCHITECTURE AND THE BINARY NUMBER SYSTEM 11 are ARM, Power PC, Sun’s Sparc processors and the like. Many of them found their applications in the embedded processing field. The main features of RISC are that they have only simple instructions implemented in a single clock. However, there is an irony in that, many RISC processors have as many complex instructions as CISC processors. Probably this can be justified by explaining that such complex instructions have been implemented using microprogramming rather than a direct hardware realization. Microprogramming is a method of implementing the control unit of a computer by breaking down instructions into a sequence of small programming steps. While the RISC versus CISC controversy is still raging, the distinction between what exactly is RISC and what is CISC is reducing to the extent of being almost indistin- guishable except at the basic philosophical level. Intel which held on to CISC for many years, bowed down to the RISC architecture by designing its Pentium Pro with complex instructions which internally were broken down to simple RISC like instructions. So the comment on it is that Pentium Pro is a RISC processor than runs CISC instructions. 0.4 | Number Systems Motivation In the study of microprocessors, we will have to use many different num- ber systems, and conversions from one system to the other. Clarity of these ideas is very important for correct computation and the right interpretation of results. This is the motivation for a review on it, though most of you have had an introduction to it already. We have become quite used to the number system which we call the decimal num- ber system, which is a system with a base (radix) 10. We are so used to this system of numbers that our visualization of quantity is always based on this. Our mental faculties are tuned to perform all calculations in this number system. In contrast, computers are not comfortable with this system—we know that they use the binary system of numbers and all computations are done in the binary format. Thus we have a problem when we use computers to perform computations for us. So let us start this discussion by first understanding the intricacies of each of the commonly used number systems. We will discuss the ones that we most often might have to use in the context of computers. 0.4.1 | The Decimal System The base of this system is 10 (ten)—and it naturally follows that there are ten defined symbols in this system—the combinations of these ten symbols give us various values. The ten symbols here are 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9, and they are called ‘digits’.The posi- tion of a digit in a number is what gives its value. For example, how does the number 346 get its value? 346 = 3 × 102 + 4 × 101 + 6 × 100 = 300 + 40 + 6 This means that, associated with each position, there is a weight. Here the weight is a power of 10.Thus 56785 = 5 × 104 + 6 × 103 + 7 × 102 + 8 × 101 + 5 × 100 = 50000 + 6000 + 700 + 80 + 5 M00_9788131787663_C00.indd 11 M00_9788131787663_C00.indd 11 7/3/2012 12:08:18 PM 7/3/2012 12:08:18 PM
  • 33. 12 EMBEDDED SYSTEMS What about fractional numbers? The positions on the right side of the decimal number also have weights, but the powers (of 10) are negative. 6.785 = 6 × 100 + 7 × 10−1 + 8 × 10−2 + 5 × 10−3 = 6 × 1 + 7 × 0.1 + 8 × 0.01 + 5 × 0.001 = 6 + 0.7 + 0.08 + 0.005 These are things that we know very well.They have been reviewed here to show that the same concept applies to other number systems as well. 0.4.2 | The Binary Number System The base of this system is 2,and so it has two symbols,0 and 1,each of them being called a bit. So each position has a weight which is a power of 2.Take the number 110110. Let us find its value. Since there are 6 bits, there are six positions with weights as shown for the bits: Power of 2: 25 +24 +23 +22 +21 +20 Weight: 32 +16 +8 +4 +2 +1 Number: 1 1 0 1 1 0 Value: 1 × 32 +1 × 16 +0 × 8 +1 × 4 +1 × 2 +0 × 1 Adding the values in all the bit positions gives 32 + 16 + 0 + 4 + 2 + 0 = 54. This is the equivalent value in the decimal system.We cannot help putting back everything into the decimal system, because this is the number system with which we are most familiar and comfortable. Note Sometimes binary numbers are suffixed with B to indicate that they are binary numbers e.g., 110110B, 1010110B. Sometimes the notation 1101102 is also used. Note Keep the calculator in the PC (Accessories of Windows) open in the scientific mode.This will help to verify all the calculations we are going to do from now on. Next, let us try to understand the concept of fractional binary numbers. Example 0.1 Find the decimal values of the binary number 1001.011 B Solution Power of 2: 23 22 21 20 2−1 2−2 2−3 Weight 8 4 2 1 0.5 0.25 0.125 Number 1 0 0 1 . 0 1 1 Value 8 + 0 + 0 + 1 . 0 + 0.25 + 0.125 = 9.375 Example 0.1 shows 1001.011 in binary (often written as 1001.0112 ). It also shows the power and weight or value of each digit position. Thus 1001.001 is equivalent in decimal to 9.375 (8 + 1 + 0.25 + 0.125). Notice that this is the sum of 23 + 20 + 2−2 + 2−3 , but 22 and 21 are not added, as the bit under these positions is 0.The fractional part is composed of 2−2 and 2−3 , but there is no digit under 2−1 , so 0.5 is not added. M00_9788131787663_C00.indd 12 M00_9788131787663_C00.indd 12 7/3/2012 12:08:18 PM 7/3/2012 12:08:18 PM
  • 34. BASICS OF COMPUTER ARCHITECTURE AND THE BINARY NUMBER SYSTEM 13 0.4.3 | The Hexadecimal Number System Next is the hexadecimal system of numbering which has 16 symbols namely 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.The base of the system is 16 and each symbol is called a ‘hex digit’. Each position in the hexadecimal number system has a weight which is a power of 16.Let us find the value of 240FCH.The letter ‘H’is suffixed to the number if it is needed to make clear that it is a hexadecimal number. A to F have the decimal values of 10 to 15. Power of 16: 164 +163 +162 +161 +160 Weight: 63536 +4096 +256 +16 +1 Number: 2 4 0 F C Value: 2 × 65536 +4 × 4096 +0 × 256 +15 × 16 +12 × 1 i.e., 131072 +16384 +0 +240 +12 = 147708 So we have calculated the equivalent decimal value of the given hex number by using the concept of positional weights. Example 0.2 Find the decimal value of the hex number 25.1H Solution Power of 16: 161 +160 +16−1 Weight: 16 +1 +0.0625 Number: 2 5 . 1 Value 2 × 16 +5 × 1 . +1 × 0.0625 i.e., 32 +5 . +0.0625 = 37.0625 There is also an octal system whose base is 8. The equivalent calculations involved in this are left as an exercise for the interested student. In all the above, we have done the conversion to decimal form from other number systems. Now we will see how we will convert a decimal number to other systems of numbering. Note i) In most computers, the default number system for writing numbers is deci- mal. When we mean decimal numbers, we simply write it as it is—like 35, 687 and 234 and so on. A number in hex form is suffixed with the letter H, for example, 56H, 8FH, 0AH and so on. ii) The numbers from 0 to 9 are the same in the decimal and the hexadecimal system.So,in the forthcoming chapters,you will see that no ‘H’is added when writing numbers from 0 to 9, though there is nothing wrong in writing 7H, 8H, 01H and so on. 0.5 | Number Format Conversions 0.5.1 | Conversion from Decimal to Binary The method is to divide the decimal number by 2, until the quotient is 0. See the tech- nique illustrated below. M00_9788131787663_C00.indd 13 M00_9788131787663_C00.indd 13 7/3/2012 12:08:18 PM 7/3/2012 12:08:18 PM
  • 35. 14 EMBEDDED SYSTEMS Example 0.3 Find the binary value of 13. Solution Divide 13 by 2 repeatedly and save the remainders 2)13 remainder = 1 2)6 remainder = 0 2)3 remainder = 1 2)1 remainder = 1 0 Now write the remainders from bottom to top, as one line from left to right. We get 1101 as the converted binary number. Thus, we have been able to convert from decimal to binary by repeated division by 2, the base of the binary number system. To verify, try converting this binary number back to decimal. It should be 13. Or simply use the scientific calculator to verify the conversion. (Make sure it is kept open on your PC’s desktop.) Example 0.4 Convert the number 213 to binary form. Solution 2)213 remainder = 1 2)106 remainder = 0 2)53 remainder = 1 2)26 remainder = 0 2)13 remainder = 1 2)6 remainder = 0 2)3 remainder = 1 2)1 remainder = 1 0 Now write the remainders from bottom to top in one line,from left to right.The number is 11010101. 0.5.2 | Conversion from Decimal to Hexadecimal Conversion from decimal to hexadecimal is accomplished by dividing by 16 and finding the remainders.Remainders ranging from 10 to 15 will be written using the hexadecimal symbols A to F. See how 225 is converted to a hexadecimal form. 16)225 remainder = 1 16)14 remainder = E 0 Result = E1 The method for this is obvious i.e.,divide repeatedly the decimal number by 16,keep the remainders. Do this until the quotient is 0. M00_9788131787663_C00.indd 14 M00_9788131787663_C00.indd 14 7/3/2012 12:08:18 PM 7/3/2012 12:08:18 PM
  • 36. BASICS OF COMPUTER ARCHITECTURE AND THE BINARY NUMBER SYSTEM 15 Example 0.5 Convert the decimal number 4152 to hexadecimal. Solution 16)4152 remainder = 8 16)259 remainder = 3 16)16 remainder = 0 16)1 remainder = 1 0 Take the remainders from bottom to top and write it in a single line from left to right. The number is 1038H. 0.5.3 | Converting from Binary to Hexadecimal If we take any hex digit,note that its decimal value ranges from 0 to 15.For example F is 15,A is 10 and so on.If a hex digit has to be converted to a binary number,the maximum number of bits required is 4. SeeTable 0.1.Any hex digit can be written as a group of four bits.Taking an example, 4C57FH can be written in binary, by writing the equivalent binary of each of the digits Hex 4. C 5 7 F Binary 0100 1100 0101 0111 1111 The binary value of 4C57FH is 01001100010101111111. Looking at both the representations tells us the biggest problem with binary numbers—they are long and cumbersome to handle. Putting them into a hex form makes the representation short and concise—we conclude that the binary representation is an expanded form of the hexadecimal representation where each hex digit is expanded to its 4-bit binary form. If we have a long binary number, what we can do to convert it into hex form is to divide it into groups of 4 bits (starting from the right i.e., the LSB). Then write the hex representation of each 4-bit binary group. Try this technique with the following binary number: 11100101010100011101. 1110 0101 0101 0001 1101 B i.e., binary E 5 5 1 D H i.e., hex Table 0.1 | Hex, Binary and Decimal Representations Decimal Hex Binary Decimal Hex Binary 0 0 0000 8 8 1000 1 1 0001 9 9 1001 2 2 0010 10 A 1010 3 3 0011 11 B 1011 4 4 0100 12 C 1100 5 5 0101 13 D 1101 6 6 0110 14 E 1110 7 7 0111 15 F 1111 M00_9788131787663_C00.indd 15 M00_9788131787663_C00.indd 15 7/3/2012 12:08:18 PM 7/3/2012 12:08:18 PM
  • 37. 16 EMBEDDED SYSTEMS Example 0.6 Convert the following binary number to hex form. 10111110000111110001. Solution It is the practice to write binary as groups of four with a space between the groups.This increases the readability of the binary number. 1011 1110 0001 1111 0001 A E 1 F 1 The equivalent hex number is AE1F1H. Example 0.7 Convert the following hexadecimal number to binary form. 3AF24H Solution Take each hexadecimal digit and write its equivalent four-bit binary value. 3 A F 2 4 0011 1010 1111 0010 0100 From all this, we should realize that the hexadecimal notation is a contracted form of rebi- nary number representation. Computers do all their processing using binary numbers, but it is easier for us to represent that binary number in hex form.So when we ask the computer to add 34H and 5DH, it actually expands these into binary form and does the addition. 0.5.4 | BCD Numbers BCD stands for ‘Binary Coded Decimal’ but there is more to it than being just a binary representation of a decimal number. Let us look into the details. Decimal numbers are represented by 10 symbols from 0 to 9, each of them being called a digit. We know the binary code for each of these decimal numbers. Suppose we represent one decimal digit as a byte,it is called ‘unpacked BCD’.Consider the represen- tation of 9—it is written as 00001001. Now if we want to write 98 in unpacked BCD, it is written as two bytes: 9 8 00001001 00001000. Thus the binary code of each decimal digit is in one byte. Packed BCD What, then, is ‘packed BCD’? When each digit is packed into 4 binary bits, it is packed BCD.Thus 98 is 9 8 1001 1000. Each digit needs a nibble (four bits) to represent it. The packed BCD form of 675 is 0110 0111 0101.The important point to remember is that since there is no digit greater M00_9788131787663_C00.indd 16 M00_9788131787663_C00.indd 16 7/3/2012 12:08:18 PM 7/3/2012 12:08:18 PM
  • 38. BASICS OF COMPUTER ARCHITECTURE AND THE BINARY NUMBER SYSTEM 17 than 9, no BCD nibble can have a code greater than ‘1001’. Computers do process BCD numbers, but the user must be aware of the number representation that is being used. Can we write BCD numbers in hex? Yes, because the hex representation is just a concise representation of binary numbers. The decimal number 675 when written as 675H represents the packed BCD, in hex form. There is no need to be confused about this, because the steps involved are: i) write the binary equivalent of each decimal number, as a nibble, ii) write the hex equivalent of each nibble. 675 is 0110 0111 0101 6 7 5 H Spend a few moments thinking, to make it clear. One important point to keep in mind is that when we represent BCD in hex form, no digit will ever take the value of A to F, since decimal digits are limited to 9.So there will never be a BCD number such as 8F5H or 56DH or A34H. Example 0.8 Find the binary, hex and packed BCD representation of the decimal numbers 126 and 245. Also write the packed BCD in the hex format. Solution Number Binary Hex BCD BCD in hex form 126 0111 1110 7EH 0001 0010 0110 126H 245 1111 0101 F5H 0010 0100 0101 245H Example 0.9 Find the packed BCD value of the decimal number 2347654, and represent the BCD in hex format. Solution To find the BCD, each digit is to be coded in 4-bit binary. Hence 2347659 is 0010 0011 0100 0111 0110 0101 1001 i.e., 2347659H is the hex representation of the BCD number. It is very important to keep this in mind, when we do programs using BCD arithmetic. Whenever you have doubts then, just refer back to this chapter. 0.5.5 | ASCII Code This word pronounced as ‘ask-ee’ is the abbreviation of the words ‘American Standard Code for Information Interchange’. This is the code used when entering data through the keyboard and displaying text on the video display. It is very important to know what it is and how this code is used. M00_9788131787663_C00.indd 17 M00_9788131787663_C00.indd 17 7/3/2012 12:08:18 PM 7/3/2012 12:08:18 PM
  • 39. 18 EMBEDDED SYSTEMS ASCII is a seven bit code,which is written as a byte.It has representations for numbers, lower case and upper case English alphabets, special characters (like # , ^ . ) and control characters.For example,there are ASCII codes for ‘new line’,carriage return and the space bar. A number of characters are related to printing. When we type a character on the key- board, it is the ASCII value of the key that is read in.The computer must convert it from this form to binary form, for processing. The list of ASCII codes is shown in Table 0.2. Note that the ASCII value of numbers from 0 to 9 is 30H to 39H. The ASCII of upper case alphabets starts from 41H and that for lower case starts from 61H.This table will be needed as quick reference for various calculations we will do in the programming chapters. 0.5.6 | Representation of Negative Numbers There are various ways of representing negative numbers—like signed magnitude, one’s complement, two’s complement and so on, but we will straightway discuss the represen- tation used by computers for this. Computers use the ‘two’s complement’ representation for negative numbers.The method is to complement each bit of the number and add a ‘1’ to this. Let us see how it is done. We will start with 4-bit numbers. Say we want to represent −6. i) Write the 4-bit binary value of 6: 0110. ii) Complement each bit: 1001. iii) Add ‘1’ to this: 1010. So –6 is ‘1010’, for computers. Let us try this for all the numbers from 0 to 7. See Table 0.3 which shows the posi- tive and negative number representation of numbers possible to be represented in four bits. A number of observations can be made from Table 0.3. i) The range of numbers that can be represented by 4 bits is −8 to +7. For an n-bit number, this range works out to be (−2n−1 ) to (+2n−1 −1). ii) In this notation, the most significant bit (MSB) is considered to be the sign bit.The MSB for positive numbers is ‘0’ and for negative numbers is 1. iii) There is a unique representation for 0. Since we will deal mostly with bytes and words (16-bit) let’s have a feel of 8-bit negative number representation. Example 0.10 Find the two’s complement number corresponding to −6 when 6 is represented in 8 bits as 0000 0110. Solution The steps: 0000 0110 1111 1001 ;complement each bit 1111 1010 ;add ‘1’ to it F A ;in hex Thus −6 is FAH in 8-bit form, while it is AH in 4-bit form (from Table 0.3) Note H is the notation for ‘hexadecimal’. M00_9788131787663_C00.indd 18 M00_9788131787663_C00.indd 18 7/3/2012 12:08:18 PM 7/3/2012 12:08:18 PM
  • 40. BASICS OF COMPUTER ARCHITECTURE AND THE BINARY NUMBER SYSTEM 19 Table 0.2 | The ASCII Code—Symbols versus Hex Value Symbol ASCII (Hex) Symbol ASCII (Hex) Symbol ASCII (Hex) Symbol ASCII (Hex) NUL 0 DLE 10 (Space) 20 0 30 SOH 1 DC1 11 ! 21 1 31 STX 2 DC2 12 “ 22 2 32 ETX 3 DC3 13 # 23 3 33 EOT 4 DC4 14 $ 24 4 34 ENQ 5 NAK 15 % 25 5 35 ACK 6 SYN 16 26 6 36 BEL 7 ETB 17 . 27 7 37 BS 8 CAN 18 ( 28 8 38 Tab 9 EM 19 ) 29 9 39 LF A SUB 1A * 2A : 3A VT B ESC 1B + 2B ; 3B FF C FS 1C , 2C 3C CR D GS 1D - 2D = 3D SO E RS 1E . 2E 3E SI F US 1F / 2F ? 3F @ 40 P 50 ` 60 P 70 A 41 Q 51 a 61 q 71 B 42 R 52 b 62 r 72 C 43 S 53 c 63 s 73 D 44 T 54 d 64 t 74 E 45 U 55 e 65 u 75 F 46 V 56 f 66 v 76 G 47 W 57 g 67 w 77 H 48 X 58 h 68 x 78 I 49 Y 59 i 69 y 79 J 4A Z 5A j 6A z 7A K 4B [ 5B k 6B { 7B L 4C / 5C l 6C 7C M 4D ] 5D m 6D } 7D N 4E ^ 5E n 6E ~ 7E O 4F – 5F o 6F 7F M00_9788131787663_C00.indd 19 M00_9788131787663_C00.indd 19 7/3/2012 12:08:18 PM 7/3/2012 12:08:18 PM
  • 41. 20 EMBEDDED SYSTEMS One very important point we need to observe and keep in mind is that, when a 4-bit number is expanded into an 8-bit form, its sign bit has to be extended into the 8 bits. The sign bit in the 4-bit representation of −6 is ‘1’. When expanding the number to fill into 8 bits, the 1 is replicated 4 more times to fill the whole byte.Thus −6 which is AH in 4-bit form, becomes FAH in byte form, and will be FFFAH in 16-bit format, and FFFF FFFAH in 32-bit format. We need to understand this for negative numbers. For positive numbers, we do it without much thinking. So +6 is 0110, which expands to be 0000 0110 (byte) or 06H, and 0006H in 16-bit format and 0000 0006 H in the 32-bit format. Note that for positive numbers,the sign bit is 0; effectively we are doing sign extension here too. This concept of ‘sign extension’is important and we will deal with it in greater detail later. Conversion from Two’s Complement Form Given the two’s complement representa- tion of a decimal number, how do we find the decimal number which it represents? The answer is—two’s complement it again. Take FA 1111 1010 ...the number 0000 0101 + ...invert each bit 1 ...add 1 0000 0110 ...its 2’s complement This is 6.Thus FA is the two’s complement representation of −6. Example 0.11 Find the decimal number whose two’s complement representation is given. i) FFF2H ii) F9H Solution i) FFF2H Taking two’s complement gives 000E which is 1110.i.e.,14—which means that −14 is the number represented by FFF2H. Table 0.3 | Negative and Positive Number Representation in 4-bit Binary Negative Numbers Binary Hex Positive Numbers Binary Hex −8 1000 8 −7 1001 9 + 7 0111 7 −6 1010 A + 6 0110 6 −5 1011 B + 5 0101 5 −4 1100 C + 4 0100 4 −3 1101 D + 3 0011 3 −2 1110 E + 2 0010 2 −1 1111 F + 1 0001 1 −0 0000 0 + 0 0000 0 M00_9788131787663_C00.indd 20 M00_9788131787663_C00.indd 20 7/3/2012 12:08:18 PM 7/3/2012 12:08:18 PM
  • 42. BASICS OF COMPUTER ARCHITECTURE AND THE BINARY NUMBER SYSTEM 21 ii) F9H Taking two’s complement gives 0111 i.e., 7, which means that −7 is the number represented by F9H. Question Looking at the result of various arithmetic operations on binary numbers, how do we know whether it is a positive or a negative number? What is your observation regarding signed numbers? Answer We should know how many bits are used for the representation of a signed number in the system.Then, if the MSB is a ‘1’, it is a negative number, if the MSB is a ‘0’, it is a positive number. 0.6 | Computer Arithmetic 0.6.1 | Addition of Unsigned Numbers When we say that a number is unsigned, it implies that the sign of the number is irrel- evant, which actually means that we consider the numbers as having no sign bit—all the bits allotted for the data are used for the magnitude alone,in effect,it turns out that these refer to positive numbers. With 8 bits, numbers from 0 to 255 can be used. Binary addition is something that you have already learnt. Here we are reviewing it to bring into focus some important points which we may have to be taken care of, in the study of microprocessor programming. Binary addition is done by adding bits column wise.We will consider byte sized data. Case 1 Binary Decimal Hexadecimal 0101 1001 + 89 + 59H + 0110 1001 105 69H 1100 0010 194 C2H Addition of the same numbers in the binary, decimal and hexadecimal formats is shown. Since the sum lies within a value of 255, there is no special problem in this case. Case 2 0111 1000 120 + 78H + 1001 1001 153 99H 10001 0001 273 111H In this case, the sum is greater than the number of bits allotted for the operand, and the extra bit, beyond the 8 bits of the sum, is called a ‘carry’. Whenever a carry appears, it indicates the insufficiency of the space allocated for the result. In microprocessors, there is a flag that indicates this condition. 0.6.2 | Addition of Packed BCD Numbers Now let us add packed BCD numbers M00_9788131787663_C00.indd 21 M00_9788131787663_C00.indd 21 7/3/2012 12:08:18 PM 7/3/2012 12:08:18 PM
  • 43. 22 EMBEDDED SYSTEMS Case 1 Consider the case of two packed BCD bytes that are to be added, say 45 and 22. Packed BCD Packed BCD in hex form Decimal 0100 0101 + 45H + 45 + 0010 0010 22H 22 0110 0111 67H 67 In this case,the upper nibble and lower nibble are within 0 to 9.So the addition proceeds just like normal decimal addition. Case 2 Consider the case of two packed BCD bytes that are to be added,say 45 and 27.In BCD form, the correct answer should be 72. However, this is not obtained directly. Packed BCD Packed BCD in hex form Decimal 0100 0101 + 45H + 45 + 0010 0111 27H 27 0110 1100 6CH 72 When adding in binary form, the lower nibble of the sum is greater than 9. Since no BCD digit can have a value greater than 9, a correction needs to be applied here. The correction to get the sum back to BCD form is to add 6 (0110) to the lower nibble alone. Correction 0110 1100 + 0000 0110 0111 0010 This gives the correct sum of 72. Case 3 This is when the upper nibble of the sum is greater than 9.The correction is to add 6 to the upper nibble alone. Add BCD 76 and 62. In binary form, the additions are 0111 0110 + 76H + 0110 0010 62H 1101 1000 + D8H + Now adding 6 to the upper nibble, 0110 0000 60H 1 0011 1000 138H However, note that the data size exceeds 99, which is the maximum s number that 8 bits can accommodate for a packed BCD number. Thus there is a ‘carry’ generated from the addition operation. However, if the carry is also included in the answer, the sum of 138 is correct. However, more than 8 bits are needed for the sum. Case 4 When both the upper and lower nibbles of the sum are greater than 9, add 6 to both nibbles. Add BCD 89 and 72. M00_9788131787663_C00.indd 22 M00_9788131787663_C00.indd 22 7/3/2012 12:08:18 PM 7/3/2012 12:08:18 PM
  • 44. BASICS OF COMPUTER ARCHITECTURE AND THE BINARY NUMBER SYSTEM 23 1000 1001 + 89H + 0111 0010 72H 1111 1011 FBH add 06 to both nibbles 0110 0110 66H 1 0110 0001 1 61H The right answer of 161 is obtained. However, the sum needs more than one byte space. Example 0.12 Perform the addition of the following numbers, after converting to decimal and hexa- decimal forms. i) 39 and 99 ii) 117 and 156 Solution Decimal Binary Hexadecimal i) 39 + 0010 0111 + 27H + 99 0110 0011 63H 138 1000 1010 8AH ii) 117 + 0111 0101 + 75H + 156 1001 1100 9CH 273 1 0001 0001 1 1 1H In the second addition, the data has exceeded the size which can be accommodated in 8 bits.Hence a carry will be generated.In microprocessors,there is a flag which indicates this condition. 0.6.3 | Addition of Negative Numbers We know now that negative numbers are represented in two’s complement notation. Let’s consider adding two negative numbers. Example 0.13 Add −43 and −56 Solution Convert the two numbers into their two’s complement form, as both are negative numbers. −43 + 1101 0101 + −56 1100 1000 −99 1 1001 1101 We are adding two 8-bit numbers. If the sum exceeds 8 bits, an extra bit is generated from the addition.Ignore this carry and look at the eight bits of the sum.(This is the rule for two’s complement addition.) M00_9788131787663_C00.indd 23 M00_9788131787663_C00.indd 23 7/3/2012 12:08:18 PM 7/3/2012 12:08:18 PM
  • 45. 24 EMBEDDED SYSTEMS It is 1001 1101.The MSB is found to be ‘1’. So we know that it is a negative number.To find the decimal number whose two’s complement representation this is, take the two’s complement of the sum.This comes to be 0110 0011 i.e., 99.Thus, we verify the correct- ness of our addition procedure. Example 0.14 Add +90 and −26. Solution One number is positive and the other is negative. +90 0101 1010 + −26 1110 0110 64 1 0100 0000 Ignore the end around carry.The sum is 0100 0000. Since the MSB of the number is ‘0’, we understand that the sum is positive. So convert it to decimal.The result is 64. Example 0.15 Add −120 and +45 Solution −120 1000 1000 + +45 0010 1101 −75 1011 0101 Look at the sum—the MSB of the sum is ‘1’. Hence, it is a negative number. The two’s complement of this is 0100 1011 i.e., 75.Thus, the result of the calculation is −75. Note In all the above calculations, we have used data of 8 bits.The result of the calcu- lations was in the range of −128 to +127. Thus, the answers are correct. If the sum goes outside this (for eight-bit data), the answers will be wrong, and havoc will be created if one is not aware of that. Computers have ‘flags’ to let us know of this. This will be dis- cussed in later sections. 0.6.4 | Subtraction Unsigned Numbers i) Binary numbers ii) Hexadecimal numbers iii) BCD numbers The procedure here is similar to addition i.e., bit by bit, column by column subtraction. Sometimes, borrows from the columns on the left are needed. M00_9788131787663_C00.indd 24 M00_9788131787663_C00.indd 24 7/3/2012 12:08:18 PM 7/3/2012 12:08:18 PM
  • 46. BASICS OF COMPUTER ARCHITECTURE AND THE BINARY NUMBER SYSTEM 25 Example 0.16 Subtract 56 from 230. Do this subtraction after converting numbers to binary and hex. Solution 230 – 1110 0110 – E6H – 56 0011 1000 38H 174 1010 1110 AEH In the above subtraction, we are subtracting a smaller number from a bigger number. However, when subtracting column-wise, sometimes there is the issue of having to subtract a bigger number from a smaller number. We know the idea of ‘borrow’ from the left-hand column. However, for the borrowing with which we append the number, depends on the base of the number system. For the decimal system, we borrow 10, for binary 2 and for hex we borrow 16. Check this hexadecimal subtraction: E6H – 38H AEH Starting from the rightmost column,we see that we cannot subtract 8 from 6.So,borrow- ing from E is needed.Borrowing from E leaves E to become D and 6 becomes 6 + 16 = 22 (in decimal). Subtracting 8 from 22 gives 14 which is E in hex. That is how we get E in rightmost column of the result.Then,going over to the left,subtract 3 from D (13 in deci- mal).This is 10 (in decimal) and A in hex.That is how the result of the subtraction is A. This idea has been explained here in detail, so that we can use a similar idea in BCD subtraction. 0.6.5 | Packed BCD Subtraction Let us use the same numbers for BCD subtraction as we did in Example 0.16. i.e., sub- tract 56 from 230.The BCD representation is shown below.Each decimal digit is packed in to 4-bit binary bits. Decimal Packed BCD 230 – 0010 0011 0000 – 56 0000 0101 0110 174 0001 0111 0100 The point to remember here is that each group of 4 bits represents a ‘decimal number’, the base of which is ten. Thus, when we try to subtract a bigger number from a smaller number, we have to consider the ‘four bits together’ as a decimal number. Let us review the steps in the above subtraction. First step Thus, when we have to subtract 6 from 0 in the rightmost group of four bits, we need to borrow. Borrow from the group on the left a decimal 10, and add it to the ‘0000’ on M00_9788131787663_C00.indd 25 M00_9788131787663_C00.indd 25 7/3/2012 12:08:18 PM 7/3/2012 12:08:18 PM
  • 47. 26 EMBEDDED SYSTEMS the right.That makes it ‘1010’(because of borrowing, the 0011 on the left is now ‘0010’). Then subtract 0110 from this. The result is 0100 as seen (within the group, binary sub- traction is done). 0010 0010 1010 – 0110 0100 Second step This is the second group. For subtracting 0101 from 0010, borrowing of decimal 10 is taken from the leftmost group.Thus 0010 is ‘1100’, 12 in decimal. Subtracting ‘0101’(5) from it, gives ‘0111’ (7) as shown. 0001 1100 1010 – 0101 0110 0111 0100 Third step The leftmost group is now 0001. Subtract 0000 from it. Thus, the final answer is 174 in packed BCD form. 0001 1101 1010 – 0000 0101 0110 0001 0111 0100 All this shows that BCD subtraction also needs extra care as BCD addition. In comput- ers, special instructions take care of this. Example 0.17 Express the numbers 53 and 18 in packed BCD and subtract the latter from the former. Solution Decimal Packed BCD 53 – 0101 0011 – 18 0001 1000 First step Borrowing from the left side nibble to the nibble on the right side gives 0100 1101 – 0001 1000 0101 Second step 0100 1101 – 0001 1000 0011 0101 The result is 35, as it should be. M00_9788131787663_C00.indd 26 M00_9788131787663_C00.indd 26 7/3/2012 12:08:18 PM 7/3/2012 12:08:18 PM
  • 48. BASICS OF COMPUTER ARCHITECTURE AND THE BINARY NUMBER SYSTEM 27 0.6.6 | Subtraction of Signed Numbers Subtraction is the process of changing the sign of the second number and adding to the first. 65−34 is 65 + (−34). So when we do subtraction, we actually add the two’s complement form (i.e., the negative) of the second number to the first number. This is what computers actu- ally do when they perform subtraction. In the discussion of subtraction in Section 0.6.4, this was not explicitly mentioned, because the idea then was to present certain other intricacies related to subtraction. Now let us discuss subtraction for 8-bit signed numbers. Keep in mind that the range of signed numbers usable with 8 bits is −128 to + 127. Example 0.18 Perform subtraction of the following signed numbers: i) +26 from +68 ii) +26 from −68 Solution i) +26 from +68 This comes to be a computation in the form of 68 + (−26). For this, the two’s comple- ment form of 26 should be added to 68. Decimal Binary 68 is 0100 0100 + −26 is 1110 0110 1 0010 1010 Ignore the extra bit generated. Since the MSB is ‘0’, the result is positive. The result is 0010 1010 i.e., 42. ii) +26 from −68 i.e., −68 – (26) −68 + (−26) −68 is (in two’s complement form) 1011 1100 + −26 1110 0110 −94 1 1010 0010 Ignore the extra bit generated. Since the MSB of the 8-bit result 1010 0010 is ‘1’, the difference of the two numbers is negative.Take the two’s complement of this. 0101 1110 i.e., 94. So the result of the computation is −94. Example 0.19 Find the result of the following subtraction: i) −56 from + 23 ii) −56 from −23 M00_9788131787663_C00.indd 27 M00_9788131787663_C00.indd 27 7/3/2012 12:08:18 PM 7/3/2012 12:08:18 PM
  • 49. 28 EMBEDDED SYSTEMS Solution i) −56 from + 23 The computation to be done is +23 – (−56) i.e., 23 + 56. This turns out to be the addition of the two positive numbers 23 and 56. 23 + 0001 0111 + 56 0011 1000 79 0100 1111 i.e., 79 ii) −56 from −23 The computation to be done is −23 − (−56) i.e., −23 + 56. −23 + 1110 1001 + 56 0011 1000 33 1 0010 0001 Ignore the extra bit generated. The MSB of the 8-bit result 0010 0001 is ‘0’. So the number is positive and is 33 in decimal, as it should be. Overflow into the Signed Bit Whenever we use 8-bit signed numbers in addition or subtraction, the result is found to be correct in sign and magnitude if it is within the range of −128 to +127.However,sup- pose this is violated? What happens then? A typical case is when two negative numbers are added. Try adding −100 and −55. Both the operands are within the allowed range. See the addition. −100 + 1001 1100 + −55 1100 1001 −155 1 0110 0101 Ignore the extra carry bit and look at the 8-bit result.The MSB of the result is ‘0’indicating that it is a positive number. However, we know that the answer is negative. What caused the error? Because the sum was too large (larger than −128) to fit into the 8 bits allotted to it,there was an ‘overflow into the sign bit’causing the sign bit to be changed.(A similar issue occurs when we add two positive numbers and the sum is greater than + 127). In computers there is a flag which tells us when there is an overflow into the sign bit caus- ing it to be inverted.These matters will be discussed in detail when we do programming. 0.6.7 | Addition of Numbers of Different Lengths We have discussed computer arithmetic in detail, because it is very important to be clear about it,so as to be able to understand how the microprocessor responds to different data types and arithmetic operations. Now let’s try to understand how data of different data widths are dealt with. Data can have different sizes depending on the processor.The 8086 can have data of 8 bits and 16 bits, while Pentium can handle 8, 16 and 32 bits internally. Sometimes it may be required to add/subtract data of different widths. In these cases, the important thing to do is to equalize the size of the data involved. Processors do not allow addition/ M00_9788131787663_C00.indd 28 M00_9788131787663_C00.indd 28 7/3/2012 12:08:18 PM 7/3/2012 12:08:18 PM
  • 50. BASICS OF COMPUTER ARCHITECTURE AND THE BINARY NUMBER SYSTEM 29 subtraction of data of different widths. So a byte will have to be converted to a 16-bit word, if it has to be added to a 16-bit number. The way it is done depends on whether the data is signed or unsigned. For unsigned data, the byte is appended with zeros in the upper byte, and converted to a 16-bit word. For signed data, the byte should be ‘sign extended’ to make it a 16-bit word. Refer Section 0.5.6 once again to convince yourself of the necessity for this. Example 0.20 Add the unsigned numbers 35H and 7890H. Solution In this, 35H is appended with zeros to make it 0035H. 0035H + 7890H 78C5H Example 0.21 Add the following signed numbers: i) 45H and A87CH ii) A8H and 1045H iii) F5H and B45CH Solution i) In this 45H should be made into a 16-bit number. Check the MSB of this byte. It is ‘0’,meaning that it is a positive number.The sign bit when extended to 16 bits makes the number 0045H.Then the addition is 0045H + A87CH A8C1H ii) In this the byte is A8H, which has an MSB of ‘1’. Thus, sign extension makes it FFA8H. Now the addition is FFA8H + 1045H 1 0FEDH The extra bit generated is ignored, like we have done in Section 0.7.3 on signed number computation. To be sure that this is correct, verification can be done as below. A8H is −88 1045H is +4165 Adding the two, gives us 4077 whose hex representation is 0FEDH. M00_9788131787663_C00.indd 29 M00_9788131787663_C00.indd 29 7/3/2012 12:08:18 PM 7/3/2012 12:08:18 PM
  • 51. 30 EMBEDDED SYSTEMS iii) Add F5H and B45CH In this, F5H is sign extended to be FFF5H Adding FFF5H + B45CH … note that this is a negative number 1 B451H Ignoring the extra carry bit, the sum is B451H, a negative number. To verify, find the decimal equivalents of the numbers which are −11 and −19364, which when added, give −19375. Note You may also verify that, without extending the negative sign, a wrong result is obtained. All the calculations we have done can be verified easily using the scientific calculator available on the PC. So, try to be adept in the use of that calculator. 0.7 | Units of Memory Capacity A memory device is one in which data is stored. How much data a memory device can store depends on its capacity. The capacity of memory is specified as multiples of bytes since memory is byte organized, which means that one byte is stored in one location in memory. So, if there are 100 locations in a memory device, 100 bytes are stored. We all have heard of memory capacity being mentioned in terms such as bytes, kilobytes and megabytes. Now let us quantify these terms. You will be hearing these terms throughout the use of this book. A byte is 8 bits. A word is not really defined. It depends on the processor used. For the 8086, a word size is 16 bits. A 32-bit processor may claim to have a word size of 32 bits. Memory capacity is always specified in bytes. 28 = 256 bytes 210 = 1024 bytes = 1KiloByte or 1KB 26 × 210 = 216 = 64 KB = 65, 536 bytes 210 × 210 = 220 = one Mega Byte (1MB) = 1024 × 1024 = 1,048, 576 bytes 210 × 220 = 230 = one Giga Byte (1 GB) = 1024 × 1024 × 1024 = 1,073, 741, 824 bytes 210 × 230 = 240 = one Terra Byte (TB) = 1024 × 1024 × 1024 × 1024 = 1,099, 511, 627, 776 bytes There are also higher units, which are not so common in usage as yet, but things will change soon, no doubt about it. Some of these units are: Peta Byte (PB) = 250 bytes Exa Byte (EB) = 260 bytes Zetta Byte (ZB) = 270 bytes M00_9788131787663_C00.indd 30 M00_9788131787663_C00.indd 30 7/3/2012 12:08:18 PM 7/3/2012 12:08:18 PM
  • 52. BASICS OF COMPUTER ARCHITECTURE AND THE BINARY NUMBER SYSTEM 31 K E Y P O I N T S O F T H I S C H A P T E R A computer system consists of a CPU, memory and I/O which communicate with one another through the system bus. The system bus comprises the data bus, address bus and the control bus. A processor’s activities are restricted to fetching, decoding and executing instructions. For reading and writing from/to memory, a number of clock cycles of time are required. The time expended for this is called the memory access time. When comparing assembly language programming with high-level language program- ming, we conclude that the former is faster in execution and more efficient and compact, but is more difficult to learn and master. RISC and CISC are two different philosophies in computer design, and even though a lot of controversy still rages around which is better, the two seem to have merged, more or less. Computers do all the computations in binary, but for entering data through the keyboard and for displaying it on the monitor, ASCII codes are used. Negative numbers are represented in two’s complement form by all computers. Q U E S T I O N S 1. Name the three most important components of a computer system. 2. Have you heard of the term‘bus contention’? What does it mean in the context of a com- puter system? 3. If the data bus width of a processor is 64 bits, what would you say about its complexity and capability? 4. If the address bus of a processor is 64 bits, what is its address space? 5. What could be a‘multi processing’system? 6. What is the first step in the execution cycle of a processor? 7. How does the system clock frequency influence the speed of processing? 8. If a system uses a 1.5-GHz clock, what is its clock period? 9. What is meant by the word‘system bus’? 10. Why should a computer have an I/O controller? 11. What are the difficulties involved in learning and using assembly language programming? 12. Name one distinguishing feature each of RISC and CISC computers. 13. How are the hexadecimal and binary number systems related? 14. When two signed positive numbers are added and the sum exceeds 127, what is the problem that arises? 15. What is the range of signed numbers that can be represented in 12 bits? M00_9788131787663_C00.indd 31 M00_9788131787663_C00.indd 31 7/3/2012 12:08:18 PM 7/3/2012 12:08:18 PM
  • 53. 32 EMBEDDED SYSTEMS E X E R C I S E S 1. Write the decimal equivalent of the following numbers: a) 31.3H b) 1100.101B c) A32.3H d) 100101B 2. Convert the following numbers to binary form: a) 34 b) 200 c) 90 3. Convert to hexadecimal format. a) 3454 b) 4523 c) 789 4. Write the binary values for: a) 34ADH b) 78FH c) 407BH 5. Write the hexadecimal values of: a) 11000101010110001B b) 10011111100001010B 6. Find the packed BCD representation of the following decimal numbers: a) 45 b) 4678 c) 802345 7. Represent the packed BCD of the following numbers in hex: a) 235 b) 9123 8. What is the ASCII of each of the following? a) 7 b) 8 c) 0 d) A e) Z f) y g) d h) * i) 9. Find the two’s complement representation of the following numbers in 8 bits: a) −45 b) −90 c) −12 d) −34 M00_9788131787663_C00.indd 32 M00_9788131787663_C00.indd 32 7/3/2012 12:08:19 PM 7/3/2012 12:08:19 PM
  • 54. BASICS OF COMPUTER ARCHITECTURE AND THE BINARY NUMBER SYSTEM 33 10. Represent the following negative numbers using 16 bits: a) −267 b) −4 c) −5676 d) −675 11. Perform binary addition for the following numbers: a) 34 and 56 b) −52 and −70 c) −47 and +120 12. Convert to packed BCD and add, a) 46 and 23 b) 55 and 67 c) 34 and 49 d) 99 and 44 13. Subtract after converting to binary form, a) −20 from −75 b) +49 from +97 c) E5H from A4H 14. Add the following signed numbers: a) F3H and 3245H b) AH and F45H c) B2H and 123EH 15. How many bytes constitute a) 5MB b) 4KB c) 32MB d) 32KB e) 8GB M00_9788131787663_C00.indd 33 M00_9788131787663_C00.indd 33 7/3/2012 12:08:19 PM 7/3/2012 12:08:19 PM
  • 55. Introduction The term ‘embedded systems’ has become very common, but is quite difficult to ‘define’, because of the large variety of devices included in this class. So, let us make an attempt to understand it, rather than make an attempt to ‘define’ it. An embedded system is an electronic system which is designed to perform one or a limited set of functions, using hardware and software. Thus, let’s examine the vast domain of embedded systems. Having hardware and software makes an embedded system a computer, but this computer performs only a limited set of functions. Thus, we exclude the PC from the embedded system world, and name it as a general purpose computer. Therefore, an embedded system is a ‘special purpose’ computing unit—meaning that it will have a processor and associated software. The software associated with the application is ‘burned’ into the ROM of the processor; therefore, it is better to designate it as a ‘firmware’. Take the case of an automobile, for example, a car. It has a number of ‘electronic control units (ECUs)’ as part of what is called ‘automobile electronics’—each of these units has a processor, which controls one or other of the various parts of the car such as engine, brakes, lights, doors and so on. Thus, embedded systems are ubiquitous, that is, omnipresent within an automobile, and adds intelligence to the operation of the vehicle. In this chapter, you will learn What is meant by the term ‘embedded systems’ The application domain of embedded systems The model of an embedded system The difference between an MCU and an MPU The working of a simple embedded system The figures of merit for an embedded system Classification of MCUs on the basis of data bus widths The history and current trends of the embedded systems industry introduction to embedded systems 1 Chapter-opening image: Development board of TI’s low power MSP 430 microcontroller. M01_9788131787663_C01.indd 34 M01_9788131787663_C01.indd 34 7/3/2012 12:08:27 PM 7/3/2012 12:08:27 PM
  • 56. INTRODUCTION TO EMBEDDED SYSTEMS 35 1.1 | Application Domain of Embedded Systems The application domain of embedded systems percolates every element of modern life— it will be easier to understand its features once we take a tour of the world of embedded systems.The following is a list: i) Consumer electronics: Cameras, music players, TVs, DVD players, microwave ovens, washing machines, refrigerators and remote controls. ii) Household appliances/home security systems: Airconditioners, intruders and fire alarm systems. ii) Automobile controls: Anti-lock braking system, engine and transmission control, door and wiper control, etc. iv) Handheld devices: Mobile phones, PDAs, MP3 players, digicams, etc. v) Medical equipments: Scanners, ECG and EEG units, testing and monitoring equipments. vi) Banking: ATMs, currency counters, etc. vii) Computer peripherals: Printers, scanners, webcams, etc. viii) Networking: Routers, switches, hubs, etc. ix) Factories: Control, automation, instrumentation and alarm systems. xi) Aviation: Airplane controls, guidance and instrumentation systems. xii) Military: Control and monitoring of military equipments. xiii) Robotics: Used in factories, household and hobby-related activities. xiii) Toys. Figure 1.1 depicts some embedded products. It is only a sample of the products in the galaxy of embedded systems. This list is incomplete, and on perusing it, you are likely to feel that anything and everything that involves modern day electronic control is an ‘embedded system’. This is not far from the truth. In fact, the only electronic equipment that we simply and easily exclude from the list is the home PC. Why do we exclude the PC from this list? We will first list out the general features of an embedded system before attempting to answer this question. 1.2 | Desirable Features and General Characteristics of Embedded Systems i) It should have one or a small set of functions which it is expected to perform efficiently. ii) It should be designed for low-power dissipation, because many systems are battery powered. iii) It has limited memory and limited number of peripherals. iv) Applications are not meant to be alterable by the user. v) Many of them are not accessible directly,that is,they may be part of the control unit of a larger system, so no interference in operation is possible. vi) They need to be highly reliable. vii) Many of them need to operate with time constraints. M01_9788131787663_C01.indd 35 M01_9788131787663_C01.indd 35 7/3/2012 12:08:28 PM 7/3/2012 12:08:28 PM
  • 57. 36 EMBEDDED SYSTEMS Figure 1.1 | Some application fields of embedded systems M01_9788131787663_C01.indd 36 M01_9788131787663_C01.indd 36 7/3/2012 12:08:28 PM 7/3/2012 12:08:28 PM
  • 58. INTRODUCTION TO EMBEDDED SYSTEMS 37 Now let’s try to understand why a PC is not considered to be an embedded system. i) The PC has a large application set, from word processing and computation to communications, printing, scanning and many more. ii) Low power consideration is a good idea, but that is not the guiding principle in its design. iii) Memory is available in various forms: RAM, ROM and secondary memory devices like the hard disk, CDROMs and the like. More memory can be added if the user desires. iv) Since the PC is used for various applications,more applications can be added as and when needed. v) The PC can be accessed by input devices like the keyboard, mouse, modem, etc. vi) Like any other system, the PC also needs to be reliable, but since it is unlikely to be the part of a very critical system, it can afford to fail once in a while (not a very good idea, though because PCs are used in critical monitoring applications sometimes). vii) The applications on the PC need to be fast for better performance, but usually there is no time criticality involved. Now that we have eliminated the general purpose PC from the list of embedded systems,the next question is whether the new handheld devices such as advanced mobile phones, PDAs, etc. can be included in the list of ‘embedded systems’.The answer is that gradually these devices are also being used for ‘general purposes’, just like a PC. But the other side of the argument is that the design of such handheld devices is similar to that of embedded systems, where processor power, memory, size, are limited, and timing is critical, even though the applications may resemble that of a PC. As such, such devices can also be thought of as embedded systems. 1.3 | Model of an Embedded System In its simplest and most general form, an embedded system consists of a processor, sensors, actuators and memory.The idea is that any application should be able to provide solution to a real-world problem, for which some data is definitely to be read in. For this, sensors are needed. This data is processed by the processor and the result of it is given to actuators which perform appropriate actions. See Figure 1.2, which is a very simple model of an embedded system. 1.4 | Microprocessor vs Microcontroller We have already talked about a processor as being the brain of an embedded system.This simply means that there should be a computational engine as the core of the system, to make it ‘intelligent’. There are two types of ‘processor units’ commonly mentioned in the literature. 1.4.1 | Microprocessor Unit (MPU) A processor like the 8086, or its advanced version, that is, Pentium, has very high computational capability,but it does not have pins or the internal architecture to interface with the external world. For such ‘microprocessors’, external chips act as peripheral M01_9788131787663_C01.indd 37 M01_9788131787663_C01.indd 37 7/3/2012 12:08:30 PM 7/3/2012 12:08:30 PM
  • 59. 38 EMBEDDED SYSTEMS Processor S S E N O R S A A C T T U O R S Memory Figure 1.2 | General model of an embedded system Figure 1.3 | An MPU with peripherals and memory external to the chip MPU Chip S S Y T E M B U S RAM ROM Parallel I/O Serial I/O Counter/ Timer Other Peripherals controllers. For example, to connect an LCD display to an MPU, a parallel port IC is to be connected externally—to have a serial transmission facility, an external serial control- ler is necessary—for timing and counting, external timers are needed. Memory can also be connected externally. Figure 1.3 shows an MPU chip connected to peripherals and memory which are physically external to the chip. Such MPUs are used as the core of general purpose computation systems, where the emphasis is on ‘computational power’ rather than interfacing capability. A PC uses an MPU, and a number of external chips together as a ‘chipset’ which acts as controllers to various peripherals. M01_9788131787663_C01.indd 38 M01_9788131787663_C01.indd 38 7/3/2012 12:08:30 PM 7/3/2012 12:08:30 PM