Full download Computer Systems: Digital Design, Fundamentals of Computer Architecture and ARM Assembly Language 2nd Edition Ata Elahi pdf docx
Full download Computer Systems: Digital Design, Fundamentals of Computer Architecture and ARM Assembly Language 2nd Edition Ata Elahi pdf docx
com
https://ebookmeta.com/product/computer-systems-digital-
design-fundamentals-of-computer-architecture-and-arm-
assembly-language-2nd-edition-ata-elahi/
OR CLICK HERE
DOWLOAD NOW
https://ebookmeta.com/product/digital-design-and-computer-
architecture-risc-v-edition-sarah-harris/
ebookmeta.com
https://ebookmeta.com/product/design-and-applications-of-emerging-
computer-systems-1st-edition-weiqiang-liu/
ebookmeta.com
https://ebookmeta.com/product/their-perfect-storm-daeria-world-
wintervale-packs-book-2-1st-edition-milly-taiden-taiden-milly/
ebookmeta.com
Social Work with Older Adults: A Biopsychosocial Approach
to Assessment and Intervention 5th Edition Mcinnis-
Dittrich
https://ebookmeta.com/product/social-work-with-older-adults-a-
biopsychosocial-approach-to-assessment-and-intervention-5th-edition-
mcinnis-dittrich/
ebookmeta.com
https://ebookmeta.com/product/a-sand-county-almanac-and-sketches-here-
and-there-aldo-leopold/
ebookmeta.com
https://ebookmeta.com/product/world-class-health-and-safety-the-
professional-s-guide-1st-edition-byrne/
ebookmeta.com
https://ebookmeta.com/product/the-emergence-and-evolution-of-religion-
by-means-of-natural-selection-1st-edition-jonathan-h-turner/
ebookmeta.com
https://ebookmeta.com/product/mapas-mentales-paso-a-paso-1st-edition-
zoraida-de-montes-montes-laura/
ebookmeta.com
Considering Inclusive Development Across Global
Educational Contexts Christopher J. Johnstone
https://ebookmeta.com/product/considering-inclusive-development-
across-global-educational-contexts-christopher-j-johnstone/
ebookmeta.com
Computer Systems
Ata Elahi
Computer Systems
Digital Design, Fundamentals of Computer
Architecture and ARM Assembly Language
Second Edition
Ata Elahi
Southern Connecticut State University
New Haven, CT, USA
© The Editor(s) (if applicable) and The Author(s), under exclusive license to Springer Nature Switzerland
AG 2018, 2022
This work is subject to copyright. All rights are solely and exclusively licensed by the Publisher, whether
the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of
illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and
transmission or information storage and retrieval, electronic adaptation, computer software, or by
similar or dissimilar methodology now known or hereafter developed.
The use of general descriptive names, registered names, trademarks, service marks, etc. in this publication
does not imply, even in the absence of a specific statement, that such names are exempt from the relevant
protective laws and regulations and therefore free for general use.
The publisher, the authors and the editors are safe to assume that the advice and information in this
book are believed to be true and accurate at the date of publication. Neither the publisher nor the authors or
the editors give a warranty, expressed or implied, with respect to the material contained herein or for any
errors or omissions that may have been made. The publisher remains neutral with regard to jurisdictional
claims in published maps and institutional affiliations.
This Springer imprint is published by the registered company Springer Nature Switzerland AG
The registered company address is: Gewerbestrasse 11, 6330 Cham, Switzerland
This book is dedicated to Sara, Shabnam, and
Aria.
Preface
Intended Audience
Organization
The material of this book is presented in such a way that no special background is
required to understand the topics.
vii
viii Preface
Chapter 1–Signals and Number Systems: Analog Signal, Digital Signal, Binary
Numbers, Addition and Subtraction of binary numbers, IEEE 754 Floating Point
representations, ASCII, Unicode, Serial Transmission, and Parallel Transmission
Chapter 2–Boolean Logics and Logic Gates: Boolean Logics, Boolean Algebra
Theorems, Logic Gates, Integrated Circuit (IC), Boolean Function, Truth Table of a
function and using Boolean Theorems to simplify Boolean Functions
Chapter 3–Minterms, Maxterms, Karnaugh Map (K-Map) and Universal Gates:
Minterms, Maxterms, Karnaugh Map (K-Map) to simplify Boolean Functions,
Don’t Care Conditions and Universal Gates
Chapter 4–Combinational Logic: Analysis of Combination Logic, Design of
Combinational Logic, Decoder, Encoder, Multiplexer, Half Adder, Full Adder,
Binary Adder, Binary Subtractor, Designing Arithmetic Logic Unit (ALU), and
BCD to Seven Segment Decoder
Chapter 5–Synchronous Sequential Logic: Sequential Logic such as S-R Latch,
D-Flip Flop, J-K Flip Flop, T-Flip Flop, Register, Shift Register, Analysis of
Sequential Logic, State Diagram, State Table, Flip Flop Excitation Table, and
Designing Counter
Chapter 6–Introduction to Computer Architecture: Components of a Microcom-
puter, CPU Technology, CPU Architecture, Instruction Execution, Pipelining, PCI,
PCI Express, USB, and HDMI
Chapter 7–Memory: Memory including RAM, SRAM, DISK, SSD, Memory
Hierarchy, Cache Memory, Cache Memory Mapping Methods, Virtual Memory,
Page Table, and the memory organization of a computer
Chapter 8– Assembly Language and ARM Instructions Part I: ARM Processor
Architecture, and ARM Instruction Set such as Data Processing, Shift, Rotate,
Unconditional Instructions and Conditional Instructions, Stack Operation, Branch,
Multiply Instructions, and several examples of converting HLL to Assembly
Language.
Chapter 9–ARM Assembly Language Programming Using Keil Development
Tools: Covers how to use Keil development software for writing assembly language
using ARM Instructions, Compiling Assembly Language, and Debugging
Chapter 10–ARM Instructions Part II and Instruction Formats: This chapter is the
continuation of Chap. 8 which covers Load and Store Instructions, Pseudo Instruc-
tions, ARM Addressing Mode, and Instruction formats.
Chapter 11–C Bitwise and Control Structures Used for Programming with C and
ARM Assembly Language
Instruction Resources: The instruction resources contain
• 15 Laboratory experiments using Logisim.
• Solutions to the problems of each chapter.
• Power points of each chapter
ix
Contents
xi
xii Contents
1.1 Introduction
Numerical values have become an integral part of our daily lives. Numerical values
can be represented by analog or digital; examples include an analog watch, digital
watch, or thermometer. The following are advantages of digital representation of
numerical values compared to analog representation:
1. Digital representation is more accurate.
2. Digital information are easier to store.
3. Digital systems are easier to design.
4. Noise has less effect.
5. Digital systems can easily be fabricated in an integrated circuit.
A digital signal is a discrete signal (step by step), and an analog signal is a
continuous signal. Digital systems are widely used and its applications can be seen in
1.1.1 CPU
Input Device
The input device is used for entering information into memory. Examples of input
devices include the keyboard, mouse, touch pad screen, light pen, barcode reader,
and scanner. The input device converts information into bits, and the bits are stored
in memory.
Output Device
A computer’s memory transfers information to the output device in the form of bits
such as the output device converts bits to characters, images, and voices which can
be interpreted by humans.
Memory
Memory is used to store information and programs. Memory comes in the form of
solid-state electronics such as RAM, ROM, flash drive, or hard disk.
1.3 Hardware and Software Components of a Computer 3
The historical development of the computer can be divided into distinct gener-
ations. The first generation of computer was constructed using vacuum tubes
and was known as ENIAC. ENIAC was developed by John Mauchly and J. Presper
Eckert at the University of Pennsylvania between 1945 and 1953. Figure 1.2 shows
an image of a vacuum tube.
The second generation of computer used transistors and were in use between
1954 and 1965. This generation of computers included the IBM 7094 (scientific)
and the Digital Equipment Corporation (DEC) PDP-1. An image of a transistor is
shown in Fig. 1.2.
The third generation of computer used integrated circuits (IC). These com-
puters were developed between 1965 and 1980, and included the IBM 360, DEC
PDP-8 and PDP-11, and Cray-1 supercomputer. An image of an integrated circuit is
shown in Fig. 1.2.
The fourth generation of computer used VLSI (Very Large Scale Integration),
an evolution of IC technology. This started around 1980 and can be found in
processors like the Intel 8080. Figure 1.2 shows an image of VLSI.
The hardware part of a computer is used for the execution of different types of
software. Figure 1.3 shows that the hardware is the lowest level component of the
computer with different types of software running on top of it.
Hardware: The hardware consists of the processor, memory, and I/O controllers.
System Software: The system software consists of the compiler and operating
system.
As mentioned before, computers come in different forms which can target specific
applications. They are:
Personal Computer (PC): Personal computers are used by individuals and come
with a keyboard and display.
Server: A server is a computer with a more powerful CPU than a PC, having
larger memory that supports the execution of large programs. Multiple users can
access this kind of computer.
Embedded Computer: An embedded computer is a computer located inside a
device which is used for controlling the operation of the device through a fixed
program. Embedded computers can be found in many devices such as dishwashers,
laundry machines, automobiles, and robots.
Supercomputer: A supercomputer is a computer with many CPUs for running
big programs such as weather prediction.
1.5 Analog Signals 5
The characteristics of a periodic analog signal are frequency, amplitude, and phase.
Frequency
Frequency (F) is the number of cycles in 1 s, F ¼ T1, where T is time of one cycle
in second and F is frequency i represented in Hz (Hertz). If each cycle of an analog
signal is repeated every 1 s, the frequency of the signal is 1 Hz. If each cycle of an
analog signal is repeated 1000 times every second (once every millisecond), the
frequency is
1 1
f ¼ ¼ ¼ 1000 Hz ¼ 1 kHz
T 103
Table 1.1 shows different values for frequency and their corresponding periods.
Amplitude
The amplitude of an analog signal is a function of time as shown in Fig. 1.7 and
may be represented in volts (unit of voltage). In other words, the amplitude is its
voltage value at any given time. At the time t1, the amplitude of the signal is V1.
Phase
Two signals with the same frequency can differ in phase. This means that one of
the signals starts at a different time from the other one. This difference can be
represented in degrees (0 to 360 ) or by radians. A phase angle of 0 indicates that
the sine wave starts at time 0, and a phase angle of 90 indicates that the signal starts
at 90 as shown in Fig. 1.8.
Example 1.1 Find the equation for a sine wave signal with a frequency of 10 Hz,
maximum amplitude of 20 V, and phase angle of 0 :
rad
ω ¼ 2πf ¼ 2 3:1416 10 ¼ 62:83
s
aðt Þ ¼ 20 sin ð62:83 t Þ
ð1101111Þ2 ¼ 1 20 þ 1 21 þ 1 22 þ 1 23 þ 0 24 þ 1 25 þ 1 26
¼ 1 þ 2 þ 4 þ 8 þ 32 þ 64 ¼ ð111Þ10
1.7 Number System 9
Or
32 þ 16 þ 0 þ 4 þ 2 þ 1 þ 1=2 þ 0 þ 1=8
To convert an integer number from decimal to binary, divide the decimal number by
the new base (2 for binary), which will result in a quotient and a remainder (either
0 or 1). The first remainder will be the least significant bit of the binary number.
Continually divide the quotient by the new base, while taking the remainders as each
subsequent bit in the binary number, until the quotient becomes 0.
Example 1.6 Convert 34 in decimal to binary.
Quotient Remainder
34/2 ¼ 17 0 ¼ a0
17/2¼ 8 1 ¼ a1
8/2 4 0 ¼ a2
4/2 2 0 ¼ a3
2/2 1 0 ¼ a4
1/2 0 1 ¼ a5
Therefore 34 ¼ (100010)2
If a binary number is made of all ones, then by using the equation 2n 1, it can be
converted to decimal.
Examples
The fraction number is multiplied by 2, the result of integer part is a1 and
fraction part multiply by 2, and then separate integer part from fraction, the integer
part represents a2; this process continues until the fraction becomes 0.
(0.35) 10 ¼ ( )2
Sometimes, the fraction does not reach 0 and the number of bits use for the
fraction depends on the accuracy that the user defines, therefore 0.35 ¼ 0.010011 in
binary.
The hexadecimal number system has a base of 16 and therefore has 16 symbols
(0 through 9, and A through F). Table 1.3 shows the decimal numbers, their binary
values from 0 to 15, and their hexadecimal equivalents.
Table 1.3 can also be used to convert a number from hexadecimal to binary and from
binary to hexadecimal.
Example 1.7 Convert the binary number 001010011010 to hexadecimal. Each
4 bits are grouped from right to left. By using Table 2.2, each 4-bit group can be
converted to its hexadecimal equivalent.
Example 1.8 Convert (3D5)16 to binary. By using Table 2.2, the result in binary is
3 D 5
0011 1101 0101
6 D B
0110 1101 1011
1 þ 0 ¼ 1, 1 þ 1 ¼ 10,
111
10101
Carry bits
þ01101
100010
In a binary number, the first bit from the left of number is called the most
significant bit (MSb), and the first bit from the right of number is called least
significant bit (LSb).
The idea of the complement makes it simple for a digital computer to perform
subtraction and addition. The complement of 1 is 0 and the complement of 0 is 1.
The complement of a binary number is calculated by complementing each bit of
the number.
Example 1.11 The complement of 101101 is 010010.
010100ðcomplementÞ þ 1 ¼ 010101
01111ðcomplementÞ þ 1 ¼ 10000
14 1 Signals and Number Systems
010101 ¼ Complement of B
001011
þ101010
110101
As we can see, adding two 6-bit number results in a 6-bit answer. There is no
carry; we just take the two’s complement of the result.
Il est le plus jeune. Il est le plus pur. Aussi le voilà désarmé, hors
des gestes qu’il faut pour atteindre le fantôme. Que lui importe, à lui
qui porte dans le cœur les palais enchantés du monde imaginaire,
tous ces châteaux, ces sacs d’or, ces dorures aux habits ? Il a dit, je
ne sais trop quand, qu’un louis par jour eût suffi à ses besoins
personnels. Il a les deux mains ouvertes. Y puise qui le veut bien. Il
paie toutes les dettes, celles de ses parents, celles de ses soldats,
celles des inconnus qui lui écrivent. Il subventionne de ses deniers
l’industrie, le commerce, règle le prix des constructions de ponts, de
routes, de canaux. Il dote et remplit les musées. Il ne possède rien
qui ne soit en même temps aux autres. Il a le dédain complet, ou
mieux l’indifférence, de tous les biens matériels. Le faste qu’il
déploie n’est qu’un des moyens de son système : « Ma propriété est
dans la gloire. »
On le voit bien dès son enfance. Il a connu toutes les générosités
expansives, toutes les amitiés fanatiques des jeunes gens qui n’ont
pas encore entrevu les vastes cieux que leur imagination enferme et
se jettent sans transition, ce qui les fait paraître ridicules, des
silences convulsifs devant les railleurs et les brutes, aux
enthousiasmes mal réglés dès qu’un esprit ou un cœur les écoute,
pour toutes les chimères qui traversent leur sentier. Il lit Jean-
Jacques, il lit Ossian, même Bernardin de Saint-Pierre. Il dévore les
écrits des philosophes et cherche à les imiter. Il veut venger sa
patrie corse. Mais que la Révolution éclate, il l’accueille ardemment,
jusqu’à se faire chasser, avec tous les siens, de sa patrie corse pour
elle. Il conservera toujours ces deux aspects, contradictoires en
apparence, qui ne dépendent en réalité que de l’interlocuteur. Il se
fermera pour les niais, se livrera aux enthousiastes, de confiance
d’ailleurs, et sans éprouver la solidité des assises de leur ferveur. Il
confiera ses grands projets à l’ondoyant et charmant Alexandre, si
prêt à devenir un fourbe quand les circonstances le voudront. Il
l’appellera son ami, l’embrassera, se promènera à son bras des
heures. Devant Desaix, devant Fox, devant Rœderer, devant
Gœthe, il s’épanchera sans réserve. Ou devant le moindre visiteur
qui manifestera quelque attention, ou quelque intelligence, ou
quelque flamme. Mais maintenant ce sera sa chimère à lui qu’il
décrira devant eux. Il croira dès l’abord à la fidélité, à l’imagination, à
la générosité des autres, les jugeant tous d’après lui [N] . Quand il se
livrera à l’Angleterre, il ne doutera pas qu’elle l’accueille comme il
eût accueilli lui-même un grand Anglais qui fût venu lui demander le
sel, le pain, l’eau et l’abri.
J’ai parlé du pardon. J’ai parlé de l’oubli. Cela va bien au delà du
pardon, au delà même de l’oubli. Le jugement lointain, d’ensemble,
intervient pour peser les hommes, et c’est celui du fataliste qui
connaît mieux que personne l’action des événements sur les âmes,
de l’égoïste supérieur qui sait le secret des mobiles, de l’homme de
volonté surnaturelle qui ne peut en vouloir aux autres de n’avoir pas
osé franchir, pour accroître et cultiver une volonté comparable, les
maux qu’il a soufferts. « Dans la complication des circonstances de
sa chute, écrit Las Cases, il voit les choses tellement en masse, et
de si haut, que les hommes lui échappent. Jamais on ne l’a surpris
animé contre aucun de ceux dont on croirait qu’il a le plus à se
plaindre. Sa plus grande marque de réprobation… est de garder le
silence sur leur compte quand on les mentionne devant lui. » Parfois
même de les défendre, parce qu’il a si puissamment vécu qu’il sait,
n’ayant pas trébuché, pourquoi tous les autres trébuchent. Ils ne
sont pas mauvais. Ils vivent selon leur nature. Et la fatalité pèse sur
eux comme sur lui : « Vous ne connaissez pas les hommes, ils sont
difficiles à saisir quand on veut être juste. Se connaissent-ils,
s’expliquent-ils bien eux-mêmes ? La plupart de ceux qui m’ont
abandonné, si j’avais continué d’être heureux, n’eussent peut-être
jamais soupçonné leur propre défection. Il est des vices et des
vertus de circonstance. Nos dernières épreuves sont au-dessus de
toutes les forces humaines ! Et puis, j’ai été plutôt abandonné que
trahi ; il y a eu plus de faiblesse autour de moi que de perfidie : c’est
le reniement de saint Pierre, le repentir et les larmes peuvent être à
la porte. A côté de cela, qui, dans l’Histoire, a eu plus de partisans et
d’amis ? Qui fut plus populaire et plus aimé ?… Non, la nature
humaine pouvait se montrer plus laide, et moi plus à plaindre ! » Ce
sont déjà les premiers accents du pessimisme romantique suivi du
consentement stoïcien de l’homme qui a su le vaincre en
s’abandonnant à l’action.