You are on page 1of 14

Assignment Set for Concept Building

(Taken from Exercises of book of Raj Kamal)

1. How does the processor, RAM, ROM and I/O units organized?
2. What is the significance of ARM processor?
-----Advanced RISC Machine (ARM) Processor is considered to be family of Central Processing Units
that is used in music players, smartphones, wearables, tablets and other consumer electronic
devices.
The architecture of ARM processor is created by Advanced RISC Machines, hence name ARM. This
needs very few instruction sets and transistors. It has very small size. This is reason that it is perfect
fit for small size devices. It has less power consumption along with reduced complexity in its
circuits.
They can be applied to various designs such as 32-bit devices and embedded systems. They can even
be upgraded according to user needs.
The main features of ARM Processor are mentioned below
1. Multiprocessing Systems –
ARM processors are designed so that they can be used in cases of multiprocessing
systems where more than one processors are used to process information. First AMP
processor introduced by name of ARMv6K had ability to support 4 CPUs along with its
hardware.

2. Tightly Coupled Memory –


Memory of ARM processors is tightly coupled. This has very fast response time. It has
low latency (quick response) that can also be used in cases of cache memory being
unpredictable.

3. Memory Management –
ARM processor has management section. This includes Memory Management Unit and
Memory Protection Unit. These management systems become very important in
managing memory efficiently.

4. Thumb-2 Technology –
Thumb-2 Technology was introduced in 2003 and was used to create variable length
instruction set. It extends 16-bit instructions of initial Thumb technology to 32-bit
instructions. It has better performance than previously used Thumb technology.

5. One cycle execution time –


ARM processor is optimized for each instruction on CPU. Each instruction is of fixed
length that allows time for fetching future instructions before executing present
instruction. ARM has CPI (Clock Per Instruction) of one cycle.

6. Pipelining –
Processing of instructions is done in parallel using pipelines. Instructions are broken
down and decoded in one pipeline stage. The pipeline advances one step at a time to
increase throughput (rate of processing).
Large number of registers –
Large number of registers are used in ARM processor to prevent large amount of memory
interactions. Registers contain data and addresses. These act as local memory store for all
operations

3. What are the advantages of internet enabled systems?


----. It provides connectionless, packet-based communication. Industrial automation has long
been a good application area for Internet-based embedded systems. Information appliances that
use the Internet are rapidly becoming another use of IP in embedded computing.

4. What is a thread?
---- A thread on the other hand is defined as “a semi-independent program segment that
executes within a process”. For embedded software developers working with microcontrollers, a
process is essentially the entire application that runs on the system. A thread is then a small
program that has a specific function and purpose within the overall application. Threads tend to
be lower level than tasks and have minimal overhead.

5. Define critical section of a task.


---- The critical section is a code segment where the shared variables can be accessed. An atomic
action is required in a critical section i.e. only one process can execute in its critical section at a
time. All the other processes have to wait to execute in their critical sections.

6. What is an exception?
--- Exceptions and interrupts are unexpected events which will disrupt the normal flow of
execution of instruction(that is currently executing by processor). An exception is an unexpected
event from within the processor. Interrupt is an unexpected event from outside the process.
7. What is meant by a pipe?
--- A pipe is simply a set of storage locations, each big enough to hold a single data item of user-
defined byte length, access to which is controlled so that it may be safely utilized by multiple
tasks.

8. State importance of embedded system in real life.


----- People often question the importance of embedded systems in daily life. These small computers
are integrated into various systems for performing specific image and data processing tasks, and thus
significantly impact the way we commute, spend our leisure time, run business, and perform various
other daily activities.

Still wondering where can you find embedded systems? Whether you work in a restaurant, office,
health practice, factory or other environment, your workplace is full of systems that are built with
embedded devices, like elevators, printers, routers and point of sale systems. In brief, they can be
found everywhere in our society — from vehicles and EV charging stations to vending machines,
lottery ticket systems and digital signage to sophisticated medical equipment.

Here are some of the reasons why embedded systems are becoming prevalent across the globe:

• They are small, fast, and powerful computers used in many devices and equipment we use
daily.
• They guarantee the performance of real-time applications.
• They are responsible for the completion of a task within a specified time limit, such as rapid
graphics processing and artificial intelligence processing.

Additionally, embedded modules are becoming more sophisticated and powerful all the time,
and are increasing in graphics performance and edge compute capabilities, giving embedded
developers the tools to bring high-performance market-driven products to market.

9. How does a pipe differ from a queue?


----
Sr. Key Pipe Message Queue
No.

Concept The pipe is the Unix IPC form to provide a Message Queue is a System VIPC
1 flow of information in one direction. form to store a list of messages.

Creation A pipe can be created using pipe() A message queue is created using
function which returns two file msgget() function which returns a
2 descriptors, one is for reading and another queue identifier.
is for writing.

3 Direction The pipe is unidirectional. A message queue is bidirectional.

Data Data can be fetched in FIFO, First In First Data can be fetched in any order.
4 Fetching Out manner.

Priorities Priorities are not present in pipes. A message can have a priority by
5 attaching a priority number to
type(s) of the message(s).

Receiver For a pipe to function, sender and receiver In a message queue, a writer
processes should be present to wait for process can write a message and
6
messages to be written and read in a pipe. exit. A reader process can read a
message later.

Persistence A pipe is deleted from the system if there A message queue remains active in
7 is no linked receiver/sender process is the system until explicitly deleted by
present. some process.

Message A pipe message size can be up to 4096 A message queue message size can
8 Size Bytes. be up to 8192 Bytes.

10. How an error handling task is executed on throwing the exception?


11. How does USB protocol function?
--- USB Protocol

USB is a polled bus, where the host initiates all data exchanges.
Transactions

Data is transferred in so called transactions. Normally, they consist of three packets:

1. The token packet is the header defining the transaction type and direction, the device
address, and the endpoint.
2. Data is transferred in a data packet.
3. The final status of the transaction is acknowledges in the handshake packet.

Pipe Model

In a transaction, data is transferred either from the USB Host to an USB Device or vice-versa. The
transfer direction is specified in the token packet that is sent from the USB Host. Then, the source
sends a data packet or indicates it has no data to transfer. In general, the destination responds with a
handshake packet indicating whether the transfer was successful.

Packet Model

Packets

Packets could be thought of as the smallest element of data transmission. Each packet transmits an
integral number of bytes at the current transmission rate. Packets start with a synchronization pattern,
followed by the data bytes of the packet, and concluded with an End-of-Packet (EOP) signal. All USB
packet patterns are transmitted least significant bit first. Before and after the packet, the bus is
in idle state.

Start-of-Frame (SOF) Packet


A special packet is the Start-of-Frame packet (SOF) that splits the USB bus into time segments. Each
pipe is allocated a slot in each frame. The Start-of-Frame packet is sent every 1ms on full speed links.
At high speed, the 1ms frame is divided into 8 microframes of 125μs each. A Start-of-Frame packet is
sent at the beginning of each microframe using the same frame number. The frame number
increments every 1ms.

12. Critically investigate about the utility of context, interrupt latency and interrupt service deadline
in the field of embedded systems.
13. Describe properly about interrupt-servicing mechanism. What do you mean by nonmaskable
and maskable interrupts?
14. State and explain about the design challenges faced during the design process of an embedded
system.
15. What is a serial port?
----. In computing, a serial port is a serial communication interface through which information
transfers in or out sequentially one bit at a time. This is in contrast to a parallel port, which
communicates multiple bits simultaneously in parallel.

16. What do you mean by plug and play device?


----- In computing, a plug and play (PnP) device or computer bus is one with a specification that
facilitates the recognition of a hardware component in a system without the need for physical
device configuration or user intervention in resolving resource conflicts.

17. What is PISO?


---- The shift register which uses parallel input and generates serial output is known as the
parallel input serial output shift register or PISO shift register. This shift register works in a
reverse way to the SIPO shift register. In this type of shift register, the input data enters a parallel
way and comes out serially. So the i/p of the second FF is the o/p of the first flip flop.

18. How synchronous communication is different from asynchronous communication?


----
S.
No. Synchronous Transmission Asynchronous Transmission

In Synchronous transmission, data is sent in In Asynchronous transmission, data is


1. form of blocks or frames. sent in form of bytes or characters.

2. Synchronous transmission is fast. Asynchronous transmission is slow.

3. Synchronous transmission is costly. Asynchronous transmission is economical.

In Asynchronous transmission, the time


In Synchronous transmission, the time interval of transmission is not constant, it
4. interval of transmission is constant. is random.
S.
No. Synchronous Transmission Asynchronous Transmission

In this transmission, users have to wait till Here, users do not have to wait for the
the transmission is complete before getting completion of transmission in order to get
5. a response back from the server. a response from the server.

In Synchronous transmission, there is no In Asynchronous transmission, there is a


6. gap present between data. gap present between data.

While in Asynchronous transmission, the


Efficient use of transmission lines is done in transmission line remains empty during a
7. synchronous transmission. gap in character transmission.

The start and stop bits are used in


The start and stop bits are not used in transmitting data that imposes extra
8. transmitting data. overhead.

19. Does a system clock always increment without stopping?


--- System clock
• A hardware-timing device programmed to tick at constant intervals T.
• An interrupt at each tick
• A chain of interrupts thus occur at periodic intervals.
• T is as per a preset count value
• The interrupts are called system clock interrupts, when used to control the schedules and
timings in the system

20. What is the utility of USB bus?

----- The Universal Serial Bus standard has been extremely successful. USB ports and cables are used
to connect hardware such as printers, scanners, keyboards, mice, flash drives, external hard drives,
joysticks, cameras, monitors, and more to computers of all kinds, including desktops, tablets,
laptops, netbooks, etc.

In fact, USB has become so common that you'll find the connection available on nearly any
computer-like device such as video game consoles, home audio/visual equipment, and even in many
automobiles.

Carry Everything You Need on a Tiny USB Stick

Before USB, many of those devices would attach to a computer over serial and parallel ports, and
others like PS/2.

Many portable devices, like smartphones, eBook readers, and small tablets, use USB primarily for
charging. USB charging has become so common that it's now easy to find replacement electrical
outlets at home improvement stores with USB ports built in, negating the need for a USB power
adapter.
21. What do you mean by the buses for networking of serial devices and buses for networking of
parallel devices?
22. With neat diagram show how parallel port interfacing can be done with touch screen.
23. With the help of block Diagram, establish CPU Interfacing With data and program Memory In PIC
microcontroller.
24. What is the advantage and disadvantage of of disabling interrupts from during the running of a
critical section of a process?
25. How does use of a counting semaphore differ from a mutex? Comment also about the
application process of counting semaphore.
----
Parameters Semaphore Mutex
Mechanism It is a type of signaling mechanism. It is a locking mechanism.
Data Type Semaphore is an integer variable. Mutex is just an object.

The wait and signal operations can modify It is modified only by the process that
Modification
a semaphore. may request or release a resource.

If no resource is free, then the process If it is locked, the process has to wait.
Resource requires a resource that should execute The process should be kept in a queue.
management wait operation. It should wait until the This needs to be accessed only when
count of the semaphore is greater than 0. the mutex is unlocked.

You can have multiple program threads


Thread You can have multiple program threads.
in mutex but not simultaneously.
Object lock is released only by the
Value can be changed by any process
Ownership process, which has obtained the lock on
releasing or obtaining the resource.
it.
Types of Semaphore are counting
Types Mutex has no subtypes.
semaphore and binary semaphore.

Semaphore value is modified using wait ()


Operation Mutex object is locked or unlocked.
and signal () operation.

It is occupied if all resources are being


In case if the object is already locked,
used and the process requesting for
Resources the process requesting resources waits
resource performs wait () operation and
Occupancy and is queued by the system before lock
blocks itself until semaphore count
is released.
becomes >1.

There are the scenarios in which more than one processes need to execute in critical section
simultaneously. However, counting semaphore can be used when we need to have more than one
process in the critical section at the same time.

The programming code of semaphore implementation is shown below which includes the structure of
semaphore and the logic using which the entry and the exit can be performed in the critical section.
In this mechanism, the entry and exit in the critical section are performed on the basis of the value of
counting semaphore. The value of counting semaphore at any point of time indicates the maximum
number of processes that can enter in the critical section at the same time.

A process which wants to enter in the critical section first decrease the semaphore value by 1 and then
check whether it gets negative or not. If it gets negative then the process is pushed in the list of blocked
processes (i.e. q) otherwise it gets enter in the critical section.

When a process exits from the critical section, it increases the counting semaphore by 1 and then checks
whether it is negative or zero. If it is negative then that means that at least one process is waiting in the
blocked state hence, to ensure bounded waiting, the first process among the list of blocked processes
will wake up and gets enter in the critical section.

The processes in the blocked list will get waked in the order in which they slept. If the value of counting
semaphore is negative then it states the number of processes in the blocked state while if it is positive
then it states the number of slots available in the critical section.

26. Does PIC16F873 microcontroller use RISC architecture?


---- Yes

27. State the real life applications of PIC16F873 microcontroller.


28. What are the different specifications of PIC16F873 microcontrollers that are required to checked
before using it for any application?
29. What is Zigbee?
---- ZigBee is a wireless networking standard that is aimed at remote control and sensor
applications which is suitable for operation in harsh radio environments and in isolated
locations. It is an established set of specifications for wireless personal area networking (WPAN).
30. What is a protocol?
---- A protocol is a set of rules and guidelines for communicating data

31. What is the full form of HDLC?


--- HDLC (High-level Data Link Control) is a group of protocols or rules for transmitting data
between network points (sometimes called nodes). In more technical terms, HDLC is a bit-
oriented, synchronous data link layer protocol created by the International Organization for
Standardization (ISO).

32. What is CAN bus?


--- Controller Area Network (CAN bus) is a serial bus protocol to connect individual systems and
sensors as an alternative to conventional multi-wire looms. It allows automotive components to
communicate on a single or dual-wire networked data bus up to 1Mbps.

33. Is there any advantage of using freeware, GNU C/C++ compiler?


---. The GNU Compiler Collection is an open source (GPL) compiler. It's found on a wide variety of
systems, ranging from GNU/Linux to every flavor of Unix, to Windows.

GCC contains support for many languages (C, C++, Fortran, to name but a few). It's highly portable, and
widely used, and tends to produce good code. It can also be used as a cross-compiler (compiling for a
system other than the one running GCC).

It's the default compiler choice for most Unix-type systems because most vendors don't bother to
write their own compilers anymore - GCC is just too good for general use.

Under Windows, Microsoft's own dev tools are often preferred because they get support for new
technologies quicker.

In high-performance programming environments (and some embedded environments) you may want
a compiler that's more highly tuned to the chip/system in question.

34. Explain the importance of the following declarations for real time application model: static,
volatile and interrupt in embedded C.
35. What is System-on-Chip (SoC) and IrDA?
---. A system on a chip, also known as an SoC, is essentially an integrated circuit or an IC that
takes a single platform and integrates an entire electronic or computer system onto it. It is,
exactly as its name suggests, an entire system on a single chip. The components that an SoC
generally looks to incorporate within itself include a central processing unit, input and output
ports, internal memory, as well as analog input and output blocks among other things. Depending
on the kind of system that has been reduced to the size of a chip, it can perform a variety of
functions including signal processing, wireless communication, artificial intelligence and more.

The Infrared Data Association (IrDA) is an industry-driven interest group that was founded in
1994[1] by around 50 companies. IrDA provides specifications for a complete set of protocols for
wireless infrared communications, and the name "IrDA" also refers to that set of protocols. The
main reason for using the IrDA protocols had been wireless data transfer over the "last one
meter" using point-and-shoot principles. Thus, it has been implemented in portable devices such
as mobile telephones, laptops, cameras, printers, and medical devices. The main characteristics
of this kind of wireless optical communication are physically secure data transfer, line-of-
sight (LOS) and very low bit error rate (BER) that makes it very efficient.
36. What is validation?
--- Validation is the “determination of the correctness of the final program or software produced
from a development project with respect to the user needs and requirements.

37. What is synthesis?


---- Synthesis is the process of taking a high-level description and turning it into a lower-level
description that, in the case of software, can be compiled directly.

38. What is a PIC microcontroller?


--- PIC microcontrollers are a family of specialized microcontroller chips produced by Microchip
Technology in Chandler, Arizona. The acronym PIC stands for "peripheral interface controller,"
although that term is rarely used nowadays.

39. What is bit rate?


---- bit rate (bitrate or as a variable R) is the number of bits that are conveyed or processed per
unit of time.

40. What is baud rate?


---- The baud rate is the rate at which information is transferred in a communication channel.

41. State the importance of DMA.


--- The DMA device can act as a bus master and can read and write physical memory. The DMA
device can be used to offload the software and processors from copying large chunks of data
from one place in memory to another. This DMA device supports two modes of operation:
contiguous transfer and scatter-gather lists.

42. Why the new age microcontrollers are smarter than the older ones?
43. Make a classification of PIC microcontrollers on the basis of internal structures.
44. What are the different memory options available for PIC microcontrollers?
--- PIC memory organization divided into 3 types of memories: Program Memory, Data Memory,
and Data EEPROM.

45. Which is the entity controlling (scheduling) the transitions from one state to another in a task?
--- Schedulers are responsible for transferring a process from one state to the other.

46. Give an example of deadlock situation during multiprocessing/multitasking execution.


47. Multitasking OS and Multitasking Scheduler - explain in terms of real life application.
48. Real time operating systems performance metrics are throughput, interrupt latencies, average
response times and deadline misses. Explain importance of each of these metrics.
49. State and explain round robin scheduling in embedded systems.
------ Round-robin scheduling (Figure 7.151) allocates each task an equal share of the CPU time.
In its simplest form, tasks are in a circular queue and when a task's allocated CPU time expires,
the task is put to the end of the queue and the new task is taken from the front of the queue.

50. Any application based embedded software of a given system is built up after selecting an
appropriate programming languge. What are the criterias of choosing the appropriate
programming language?
51. Analyse the feature in C that makes it popular high level language for an embedded system.
---- Although not originally designed for embedded software development, the C language allows
a range of programming styles from high-level application code down to direct low-level
manipulation of hardware registers. As a result, C has become the most popular programming
language for embedded systems today.

52. Why do you break a program into header files, configuration files, modules and function?
53. Why do you use an infinite loop in embedded software? Explain with proper justification.
----- Infinite loops are used in embedded systems so as to repeat the task required to be performed by
the system. By this the embedded system designed remains functional through out its usage.

Personal computers have an operating system and once the program is executed, It returns control on
the operating system, where as on the other hand Embedded systems do not have an operating
system and therefore we cannot let the control fall out of the program.

54. How half duplex is different from full duplex?


---- In simplex mode, Sender can send the data but that sender can't receive the data. In Half
Duplex mode, Sender can send the data and also can receive the data but one at a time. In Full
Duplex mode, Sender can send the data and also can receive the data simultaneously.

55. What is the need of handshaking signals?


----- Handshaking (either software codes or hardware signals) is used to halt transmission of data
from the sending computer until the receiving computer has emptied the buffer. Various
functions are available in BASIC to allow either software or hardware handshaking.

56. What is the difference between serial port and parallel port?
------
Serial Key
Ports

Purpose Serial Port is used for serial data Parallel Port is used for parallel
1
transmission. data transmission.

Transmission Transmission speed of a serial port Transmission speed of a parallel


2 Speed is slow as compared to a parallel port is quiet high as compared to
port. a serial port.

Redundancy Bottom-Up model is better suited as Top-down model has high ratio
it ensures minimum data of redundancy as the size of
3
redundancy and focus is on re- project increases.
usability.
Serial Key
Ports

No. Of Wires Wire connections to serial port are No. of wires that are connected
4 quiet less as compared to parallel to parallel port are quiet high as
port. compared to serial port.

57. What is the difference between counter and timer?

58. State the difference between flip flop and latch.

Parameter Flip-Flop Latch

Basic Principle Flip-flop utilizes an edge triggering approach. Latch follows a level triggering approach.

Clock Signal The clock signal is present. The clock signal is absent.

Designed You can design it using Latches along with a You can design it using Logic gates.
Using clock.

Sensitivity Flip-flop is sensitive to the applied input and Latches are sensitive to the applied input
the clock signal. signal- only when enabled.

Operating It has a slow operating speed. It has comparatively fast operating speed.
Speed

Classification You can classify a flip-flop into a synchronous A user cannot classify the Latch this way.
or asynchronous flip-flop.

59. What is the utility of RS232C port?


--- RS-232C is the interface that your computer uses to talk to and exchange data with your
modem and other serial devices.

60. What are advantages of re-entrant functions in embedded system software?


------ In embedded systems, you may have a processor with limited EEPROM/FLASH/RAM, where
functions are accessing global memory and are not re-entrant. Have you ever had to disable interrupts
and perform actions that could not be interrupted - not a re-entrant function. High priority interrupts
would be examples of a non re-entrant functions. Almost all functions we come across are re-entrant.
Usually not re-entrant functions relate to gui, interrupts, global memory, or semaphore guarded
access.

Even if your chip is ARM and you have MB of RAM, 1 Gbit data rate from a CMOS camera chip can max
you out pretty fast. The best example that comes to mind is processing image flow on ARM9
processor.

I have coded a consumer thread function that would run multiple consumers in order to process large
amount of data without draining RAM. I can see lots of uses of re-entrant functions in protocol stacks
in the embedded , personal computer, and server world.

In my case, I could split a large data pieces into smaller pieces and use the same thread call as 8
consumers. RAM consumption and memory manipulation on smaller data pieces had a significantly
smaller footprint.

My bottle neck was IO on both sides of the re-entrant function(s). Having multiple consumers enabled
me to have IO going pretty much non-stop. While one consumer is processing data, another consumer
is using IO read/write calls.

61. State if any advantage of polymorphism while programming with C++?

---- Polymorphism in C++ allows us to reuse code by creating one function that's usable for multiple
uses. We can also make operators polymorphic and use them to add not only numbers but also
combine strings. This saves time and allows for a more streamlined program.
62. State the utilities and features of JAVA that makes it a highly useful high level language for an
embedded system in many network related applications.
63. Each process or task has an endless loop in preemptive scheduler. How does the control of
resources transfer from one task to another?
64. What do you understand by throwing an exception? Evaluate the exception function handling
during execution of a routine.
---- The object, called an exception object, contains information about the error, including its
type and the state of the program when the error occurred. Creating an exception object
and handing it to the runtime system is called throwing an exception.

65. Examine about the uses of hardware and software assigned priorities in an interrupt
mechanism.
---- Hardware interrupts are used by devices to communicate that they require
attention from the operating system. Internally, hardware interrupts are
implemented using electronic alerting signals that are sent to the processor from an
external device, which is either a part of the computer itself, such as a disk
controller, or an external peripheral.
A software
interrupt
is caused either by an exceptional condition in the processor itself, or a special instruction in the
instruction which causes an
interrupt
when it is executed. The former is often called a trap or exception and is used for
errors or events occurring during program executions that are exceptional enough
that they cannot be handled within the program itself.

66. What is a device driver?


---- A device driver is computer program that allows a system to interface with hardware
devices.

67. What is soft real time and hard real time?


---- A hard-real time system is a system in which a failure to meet even a single deadline may lead
to complete or appalling system failure. A soft real-time system is a system in which one or more
failures to meet the deadline are not considered complete system failure, but that performance
is considered to be degraded.

68. What is a buffer?


----- A buffer is a data area shared by hardware devices or program processes that operate at
different speeds or with different sets of priorities.

You might also like