Binder 1
Binder 1
SYSTEM
Learning Objectives
1.1 Introduction
1.5.3 Memory
1.7.1 Registers
1.7.3 Pipeline
1.8 Exceptions, Interrupts, and the Vector Table
Defines separate memory banks for Uses only one memory for storage of both
data and program storage. data and program.
Provides instruction parallelism. This The memory fetch operation must take
means that fetching of next and place first and this is followed by execution
execution of next instruction can of next instruction. The fetching of next
take place simultaneously instruction can take place only after
completion of execution of present
instruction. Hence the program execution
requires more time.
The design of chip provides The chip design is simplified as only one
additional hardware to identify the memory is to be identified.
program and data memory.
The instructions will take same The execution time varies widely.
number of cycles
Execution of instruction requires Large numbers of cycles are required for
fewer cycles. execution.
Arm Embedded 1
1.3 RISC DESIGN PHILOSOPHY
(RISC: Reduced Instruction Set Computing)
RISC is a design Philosophy where you reduce the COMPLEXITY of the instruction
set, which will reduce the amount of space, time, cost, power, heat and other
things it takes to implement the instruction set part of a processor. It is aimed at
delivering simple but powerful instructions that execute within a single cycle at a
high clock speed. There are a number of factors which have transformed RISC
technology into a success in the marketplace.
The RISC philosophy concentrates on reducing the complexity of instructions
performed by the between because it is easier to provide greater flexibility and
intelligence in software rather than hardware.
RISC design places greater demands on the complier.
CISC instruction more on hardware.
The figure 1.2 shows emphasize of RISC and CISC
RISC: Possible
2.Pipelines
(Parallel CISC: Not possible
Execution)
Many GPRS in RISC
3. Register
Few GPRS in CISC
Low-Battery
High code Less Compact Hardware Core
Power
Density Price in Size Debug Enhanced
Technology RISC
Architecture
High code density is another major requirement since embedded system has
limited memory due to cost and physical size restrictions.
ARM processor has been specifically designed to reduce power consumption and
extended battery operation-essential for applications such as mobile phones and
personal digital assistants.
Embedded systems are price sensitive and use slow and low cost memory
devices.
1 Microprocessors and
ARM processor demand to reduce the area of the die taken up the embedded
processor, the more available space for specialized peripherals.
ARM has incorporated between debug technologies with in the processor so that
between engineers can view what is happening while the processor is executing
code.
ARM Code is not a pure RISC architecture because of the constraints of its
primary application - the embedded system.
Comparison between RISC and CISC :
RISC CISC
Lesser no. of instructions Greater no. of Instructions
Instruction Pipelining and Generally no instruction pipelining feature
increased execution speed
External
ARM RAM
Memory control
External
Intr.contr ROM
AHB External Bus
AHB Extension
orbitrar
AHB-APB
Bridge
Barrel Shifter
The barrel shifter features a 32-bit input to be shifted. This input is coming back
from the register file or it might be immediate data. The shifter has different
control inputs coming back from the instruction register. The Shift field within the
instruction controls the operation of the barrel shifter. This field indicates the
kind of shift to be performed (logical left or right, arithmetic right or rotate
right). The quantity by which the register ought to be shifted is contained in an
immediate field within the instruction or it might be the lower 6 bits of a register
within the register file.
The shift_val input bus is 6-bits, permitting up to 32 bit shift. The shifttype
indicates the needed shift sort of 00, 01, 10, 11 are corresponding to shift left, shift
Arm Embedded 1
right, an arithmetic shift right and rotate right, respectively. The barrel shifter is
especially created with multiplexers.
Control Unit
For any microprocessor, control unit is the heart of the whole process and it is
responsible for the system operation, so the control unit design is the most
important part within the whole design. The control unit is sometimes a pure
combinational circuit design. Here, the control unit is implemented by easy state
machine. The processor timing is additionally included within the control unit.
Signals from the control unit are connected to each component within the processor
to supervise its operation.
The final thing that must be explained is how the ARM will be used and the way in
which the chip appear. The various signals that interface with the processor are
input, output or supervisory signals which will be used to control the ARM
operation.
An example of an ARM-based embedded device, a microcontroller.
The lines connecting the boxes are the buses carrying data. We can separate the
device into 4 main hardware components.
The ARM processor controls the embedded device.
Different versions of the ARM processor are available to suit the desired
operating characteristics. An ARM processor comprises a core plus the
surrounding components that interface it with a bus.
Controllers coordinate important functional blocks of the system. Two commonly
found controllers are interrupt and memory controllers.
The peripherals provide all the input-output capability external to the chip and
are responsible for the uniqueness of the embedded device.
A bus is used to communicate between different-parts of the device.
The contrast, embedded devices use on chip i.e, internal to the chip and that
allows different peripheral devices to be interconnected with an ARM core.
There are two different classes of devices attached to the bus
1. ARM processor core is a bus master.
o A logical device capable of initiating a data transfer with another device
across the same bus.
2. Peripherals tend to be bus slaves
o Logical devices capable only of responding to a transfer request from a
bus master device.
A bus has two architecture levels
1. Physical level that covers the electrical characteristics and bus width.
2. Second level deals with protocol-the logical roles that govern the
communication between the processor and a peripheral.
ASB AHB
(ARM System APB
(ARM Peripheral Bus) (ARM High
Bus) Performance Bus)
1.5.3 Memory
Memory is any physical device capable of storing information temporarily or
permanently. For example, Random Access Memory (RAM), is a volatile memory
that stores information on an integrated circuit used by the operating system,
software, and hardware. Memory width is the number of bits the memory returns
on each access typically 8, 16, 32, or 64 bits.
The memory width has a direct effect on the overall performance and cost ratio. An
embedded system has to be have some form of memory to store and execute code.
Arm Embedded 1
You have to compare price, performance and power consumption when deciding
upon specific memory characteristics such as hierarchy, width and type.
Hierarchy
All computer system have memory arranged in some form of hierarchy. There is an
option of a cache to improve memory performance.
The figure 1.5 shows memory trade-off
Secondary
Primary ROM (Code
RAM (DATA memory)
memory)
ROM DRAM
Flash Rom SRAM SDRAM
(Boot code) (Refresh)
(Firm ware) (Faster) (High speed)
1 Microprocessors and
ROM: Read-only memory (ROM) is the least flexible of all memory types because it
contains an image that is permanently set at production time and cannot be
reprogrammed. Devices use a ROM to hold boot code. Its main use is for holding
the device firmware or storing long-term data that needs to be preserved after power
is off.
Flash ROM : It can be written to as well as read, but it is slow to write so you
should not use it for holding dynamic data. Its main use is for holding the device
firmware or storing the long term data that needs to be preserved after power is off.
DRAM: Dynamic Random Access Memory (DRAM) is the most commonly used RAM
for devices. It has the lowest cost per megabyte compared with other types of RAM.
DRAM is dynamic- it needs to have its storage cells refreshed and given a new
electronic charge every few milliseconds, so you need to set up a DRAM controller
before using the memory.
SRAM: Static Random Access Memory (SRAM) is faster than the more traditional
DRAM, but requires more silicon area. SRAM is static-the RAM does not require
refreshing.
SDRAM: SDRAM stands for Synchronous Dynamic Random Access Memory. It is
one of the DRAM type. It runs at high clock speed compare to conventional memory.
It gets synchronize with processor bus as SDRAM is clocked.
ARM PERIPHERALS
A peripheral device performs input and output functions for the chip by connecting
to other devices or sensors that are off-chip.
All ARM peripherals are memory mapped-the programming interface is a set of
memory- addressed registers. The address of these registers is an offset from a
specific peripheral base address.
Controllers are specialized peripherals that implement higher levels of
functionality within an embedded system.
Peripherals range from a simple serial communication device to a more complex
802.11 wireless device.
Controllers are specialized peripherals that implement higher levels
of functionality with in an embedded system.
Two important types of controllers are memory controllers and interrupt
controllers.
Specialized Peripherals
1 Microprocessors and
Memory controller Interrupt controller
SIC VIC
Memory Controllers
Memory controllers connect different types of memory to the processor bus. On power-
up a memory controller is configured in hardware to allow certain memory devices to
be active. These memory devices allow the initialization code to be executed. Some
memory devices must be set up by software; for example, when using DRAM, you
first have to set up the memory timings and refresh rate before it can be accessed.
Interrupt Controllers
An interrupt controller provides a programmable governing policy that allows
software to determine which peripheral or device can interrupt the processor at any
specific time by setting the appropriate bus in the interrupt controller registers.
There are two types of interrupt controller available for the ARM processor.
1. The standard interrupt controller
2. Vector Interrupt controller (VIC)
Application
OS
Initialization Device
Driver
Hardware device
Initial Diagnostics
Hardware Platform OS (Linux)
Configuration RTOS
(VX works)
User mode
Fast interrupt Request (r8-r14) (FIQ)
1 Microprocessors and
Interrupt Request (r13 and r14) IRQ
Unconditional
Execution
1. ARM: The ARM instructions are 32 bits long. ƒ Most instructions execute in a
single cycle. ƒ Most instructions can be conditionally executed.
2. Thumb: Thumb is a 16 ‐bit instruction set – Optimized for code density from C
code. also Improved performance form narrow memory and it is the subset of
the functionality of the ARM instruction set
3. Jazelle: The Jazelle J and Thumb T bits in the CPSR reflect the state of the
processor. When both J and T bits are 0, the processor is in ARM state and
executes ARM instructions. This is the case when power is applied to the
processor.
Arm Embedded 1
The table compares the ARM and thumb instruction set features ARM
and thumb instruction set features
The figure 1.16 illustrates the pipeline using a simple example. It shows a sequence
at three instructions being fetched, decoded and executed by the processor. Each
instruction takes a single cycle to complete after the pipeline is filled.
1 Microprocessors and
The three instructions are placed into the pipeline sequentially. In the first cycle the
core fetches the ADD instructions from memory. In the second cycle the core
fetches the SUB instructions and decodes the ADD instruction.
In the third cycle, both the SUB and ADD instructions are moved along the
pipeline. The ADD instruction is executed the SUB instruction is decoded, and the
CMP instruction is fetched. This procedure is call filling the pipeline. The pipeline
allows the core to execute on instruction every cycle.
As the pipeline length increases, the amount of work done at each state is reduced,
which allows the processor to attain a higher operating frequency. This in turn
increases the performance. The system latency also increases because it takes more
cycles to fill the pipeline before the core can execute an instruction.
The pipeline design for each ARM family differs. For example, the ARM of 9 core
increases the pipeline length to five stages as shown in the figure 4.17 below.
The ARM 9 adds a memory and write stage, which allows the ARM 9 to process on
average 1.1 Dhrystone MIPS/MHZ
The ARM 10 increases the pipeline length still further by adding a sixth stage as
shown in the figure 1.18 below
The ARM 10 can process on average 1.3 Dhrystone MIPS per MHZ
the CPSR to enable the IRQ interrupts, once the ADD instruction enters the execute
stage of the pipeline, IRQ interrupts are enabled.
The below figure 1.20 illustrates the use of the pipeline and the program counter PC
Each vector table entry contains a form of branch instruction and points to the
start of a specific routine
Reset vector is the location of the first instruction executed by the processor
when power is applied.
Undefined instruction vector is used when the processor cannot decode an
instruction.
Software interrupt vector is called when you execute SWI instruction. The SWI
instruction is frequently used as the mechanism to invoke an operating system
routine.
Pre-fetch abort vector occurs when the processor attempts to fetch an
instruction from an address without the core-access permissions. The actual
abort occurs in the decode stage.
Data abort vector is similar to a pre-fetch abort but is raised when an
instruction attempts to access memory without the correct access permission.
1 Microprocessors and
Interrupt request vector is used by external hardware to interrupt the normal
flow of the processor.
Fast interrupt request vector is reserved for hardware requiring faster response
times.
6. Memory management
7. Coprocessor interface
Cache and tightly coupled memory
The cache is a block of fast memory placed between main memory and the core. It
allows for more efficient fetches from some memory types.
Most ARM-based embedded system use a single-level cache internal to the
processor.
ARM has two forms of cache. The first is found attached to the Von Neumann-
style cores. It combines both data and instruction into a single unified cache as
shown in figure 1.21.
1. Explain the architecture of a typical embedded based on ARM core with a neat
diagram.
2. Explain the concepts of pipeline and interrupts used in ARM processor.
3. Differentiate between RISC and CISC processor.
4. Explain ARM core data flow model with a neat diagram.
5. Discuss briefly how coprocessor can be attached to ARM processor.
6. Explain the AMBA interface with a neat diagram and where is it present in the
architecture ?
7. List out the features of ARM processor.
8. List the features of CISC and RISC processor
9. Write a short note on ARM memory hierarchy.
10. Briefly explain the embedded system software with a neat diagram.
11.Draw and explain the ARM processor model or register set of ARM processor
1. Explain the difference between microprocessor and microcontrollers
2. Explain the difference between CISC and RISC architectures.
3. Explain the ARM design philosophy (Physical features that have driven ARM
processor design).
1 Microprocessors and
4. Explain with a neat diagram, the embedded system hardware based on ARM
core.
5. Write a short notes on i) ARM bus technology ii) AMBA bus protocol iii) Memory
iv) Memory Controller
6. Explain embedded system software( Initialization code, operating system and
applications)
7. Explain with a neat diagram, ARM core data flow model.
8. Briefly explain the seven basic operating modes of ARM core with relevant
diagram. With a neat diagram, explain the register organization of ARM.
9. With a suitable diagram, explain Conditional code flags(CPSR) of ARM RM.
10.Explain the pipeline execution of ARM instructions with an example.
11.Explain the core extensions of ARM with diagrams.
Fourth Semester BE Degree Examination, June/July 2017
1. (a) Explain execution unit (EU) and Bus Interface Unit (BIU) of 8086 p with a
neat diagram [08 Marks]
(b) Explain the different addressing modes used in 8086 p with suitable
example [08 Marks]
OR
2. (a) Explain all bits of flag register of 8086 p with a neat diagram. Show the
setting and resetting of flag bits with a suitable example. [06 Marks]
(b) Write an assembly level program (ALP) to add two bytes of data stored at data
1 and data 2 and save the result in sum with comments. Identify all the
directives found in the program. [06 Marks]
(c) Show the memory dump for the following data section or data segment.
[04 Marks]
Module - 2
(b) With a suitable program show how a packed BCD value is converted to ASCII
value [04 Marks]
(c) Assume that there is a class of five people. With following grades: 69, 87, 96,
45, 75. Write an ALP to find the highest grade [06 Marks]
OR
4. (a) Write on ALP that adds the following two multiword numbers and saves the
result: Data 1 = 548FB9963CE7 and Data 2 = 3FCD4FA23B8DH [08 Marks]
(b) Write an ALP to perform the following:
(c) Explain 74138 decoder configuration to enable the memory address F0000H
to F7FFFH to connect four 8 K RAMS [06 Marks]
OR
6. (a) Briefly explain the control word format of 8255 in I/O mode and BSR mode.
Find the control word if PA = out, PB = in, PC0-PC3 in and PC4-PC7 out. Use
port addresses of 300H-303H for the 8255 chip. Then get data from port B
and send it to part A [08 Marks]
(b) Assume that we have 4 bytes of hexadecimal data: 25H, 62H, 3FH and 52H.
(iii) If the second byte 62H had been changed to 22H. Show how checksum
detects the error. [08 Marks]
Module - 4
(b) Explain ARM core data flow model with a neat diagram [06 Marks]
8. (a) Explain the architecture of a embedded device based on ARM core with a
neat diagram [08 Marks]
(b) Explain the concept of pipeline and interrupts used in ARM processor
[08 Marks]
Examiniation Question 2
Module - 5
9. (a) Explain the following instructions of ARM processor with suitable example
(i) MLA (ii) QADD (iii) SMELL (iv) LSI. [08 Marks]
(b) Write an ALP to copy of data (Block D to another block (Block 2) using ARM
instructions. [04 Marks]
OR
10.(a) Write an ALP using ARM instructions that calls subroutine fact to find the
factorial of a given number. [08 Marks]
(b) Write short notes on memory access and branch instructions of ARM
controller [08 Marks]
2 Microprocessors and
11.(a) Explain the architecture of 8086 microprocessor with a neat diagram along
with functions of various blocks. [06 Marks]
(b) With an example distinguish between physical address, logical address and
offset address. If CS = 2000 h, DS = 3000 h, SS = 4000 h, ES = 5000 h,
BX = 0020 h, BP = 0030 h. Find physical address for (i) MOV AL, [BP]
(ii) MOV CX, [BX] [04 Marks]
(iii)Direct memory
OR
12.(a) What are assembler directives? Explain the following assembler directives
(i) PROC, (ii) Assume, (iii) PTR. [04 Marks]
(b) Write assembly language program to add 5 bytes of data stored in data
segment. [04 Marks]
(c) With syntax, explain the following control transfer instructions:
(i) Conditional transfer
(i) DAA (ii) MUL (iii) AND (iv) SHR (v) CMP (vi) AAM
[06 Marks]
Examiniation Question 2
(b) Write a program to convert lower case to upper case by reading string from
KB and print the converted string at 10 th row, 20th column after clearing the
screen. [06 Marks]
(c) Write an ALP to count the number of one‟s and zero‟s in a given 8 bit data
using rotate instructions. [04 Marks]
OR
14.(a) Explain the syntax of following instructions with example: (i) AAA, (ii) SHL,
(iii) DIV, (iv) RCR. [04 Marks]
(b) What is an interrupt? Explain various types with an interrupt vector table.
[06 Marks]
(c) Write an ALP to sort a given set of 16 bit numbers in ascending order using
any sorting method. [06 Marks]
Module - 3
15.(a) With an example how to identify over flow and under flow using flags in a flag
register for performing arithmetic operation on 16 bit number. [06 Marks]
(b) Write the syntax of following instruction and explain with an example:
(i) CBW, (ii) IDIV, (iii) CMPSB, (iv) Xlat [04 Marks]
(c) Design a memory system for 8086 with one 64 KB RAM and one 64 KB ROM
at address 30000h and F0000h show the complete design along with
memory mapping and draw the final diagram with address decoder.
[06 Marks]
OR
16.(a) With block diagram, explain 8255 and write control word register format for
PA output, PB input in mode 0. [06 Marks]
(b)
Write an ALP to read PB and check number of one‟s in a given 8 bit data at PB
and display FFh on PA if it is even parity else 00h on PA if it is odd parity
[05 Marks]
(c)
Write a program using string instructions to accept a string from keyboard
and check for palindrome and accordingly display appropriate message
[05 Marks]
2 Microprocessors and
Module - 4
(b) Explain the programmer‟s model of ARM processor with complete register
sets available. [04 Marks]
(c) With diagram explain the various blocks in a 3 stage pipeline of ARM
processor organisation. [04 Marks]
(d) Explain registers used under various modes. [04 Marks]
OR
18.(a) Explain the structure of ARM cross development tool kit [06 Marks]
(b) Describe the various modes of operation of ARM processor [05 Marks]
(c) Explain the various fields in Current Program Status Register (CPSR),
[05 Marks]
Module - 5
19.(a) Explain the syntax with example the following instructions of ARM processor
(i) MVN, (ii) RSB, (iii) ORR, (iv) MLA, (v) LDR [05 Marks]
(b) Write a program to display message “Hellow world” using ARM7 processor.
[04 Marks]
(d) If r5 = 5, r7 = 8 and using the following instruction, write values of r5, r7 after
execution MOV r7, r5, LSL # 2. [03 Marks]
OR
(b) Explain various types of multiply instructions with syntax and example
[04 Marks]
(c) What are the salient features of ARM instruction set? [05 Marks]
(d) If r1 = 0b1111, r2 = 0b0101, find r0 after BIC r0, r1, r2 [03 Marks]
Examiniation Question 2
BIBLOGRAPHY
1. The X86 PC Assembly Language, Design Interfacing by Muhammad Ali Mazidi
|Janice Mazid Danny Causey fifth Edition,and Pearson.