Computer Architecture
Digital Systems program Execution Flow
•
:
•
Micro Processors :
Chips that
require the
logic to Sequential Execution :
Step by step , top to bottom in
Interfaced with
order of how
they appear
execute a
program .
memory that
if Branching achieved else
else is
using if construct
- - '
--
an .
contains data and
programs
.
else is not
else if is a cascaded condition mandatory .
•
Micro Controllers Chips that combine
processor
: a
Nested if :
If . .
inside another condition is called
nesting .
with some
memory
and external interfaces on
single
die
Loops
used in embed ed function
-
.
Most loops are set to start on a
given condition ,
run
for a
specific
AND OR NOT time and then terminate .
A
Y A A Y
Y
While loops control into the loop block
B
entry
B
Y AB A B Y ft
-
loop block will
only
execute the block
if the check condition is
y
- -
-
= +
true .
Condition only checked at the start of the loop
A B Y A B Y A Y
do white checks the condition to the
loop code must be
get
- -
o o o o o • ,
O l .
O l O O l l run once .
I O O '
l O l l O
For loop -
checked at the start the loop loop controls
l l l
of
-
, i , ,
are
included in the loop definition .
C switch
programming
•
Switch statement check between
Header Includes the needed to be
for equality
an
integer and in
libary functions
:
program .
some cases labels and then executes the case that matches
Main function The the
is executed
by running the code
integer
:
program
.
this
in main
function
Indicates pointer
Body : Contains the instructions to be executed . Pointers type
I
' '
char t ;
g
-
-
*
Stages of
*
•
int char
compilation :
my
pointer ; p i
¥p&?
d H the
d
address of is
assigned to
p
Preprocessing Expands
g
I, bases
Macros &
type of
-
:
-
references Name of
.
H contains the
' '
g
now u
data
Compiling Compiles to assembly pointer
-
: -
to
pointed
Assembling Assembling the object file
-
:
Arrays A
char
gT-D://dedeah.cn of an
array
way of combining
.
Linking Links object files into executable
:
single
-
float f- LD 's 11
a A with 7 elements
.
float array
information of the same
type
{ 9111 declaring an
'
-5
'
'
4
'
char
Variables
'
referring to them
by y
-
and a .
,
array
by assignment
single variable
.
name
Each
Memory bytes byte ED 's 112nA Element
.
small containers of
of memory
int score
-
in score is
-
y
-
.
Array ED ;
to
int an assigned y
is
assigned a
unique member
indicating its location
*
( an 1)
char tic tac -63133 ;D 3rd row ,
3rd column .
Array + =3 ; Hsets the 2nd element
or address .
The address of the variable is the 't
in the
array
& an
int
Array ;
-
p
Strings
-
lowest An characters
number of It increases
array of
-
bytes
address 1
. ptt ; pointer by
Strings
*
2 ; 11 sets the 2nd element terminated If
-
p
-
in are
Expressions -
Combination
of operands and
operators that the
array .
char name LD -
-
{ '
j
'
.
a'
'
,
'
m
'
,
'
e' is
'
,
'
tf I
'
logical
make sense .
last Name D=
"
Cortex
"
Structures char
Operands -
a variable on a constant value
that has
Nogicat
action
Operator -
a mathematical struct is a C construct that arrows users to define their own
type of
to be
performed
on the operator .
combining several data types -
allows a
single reference to a complex format
Dot
operator ( ) to struct
o
used access member variable within the
Statements Statements end in
always semicolon; tells
:
a
more efficient way optimising memory use is to define the bit
-
of
the compiler that it is the end of an instruction .
length of member variables in struct
using bitfields
a () - :
" " " "
%
"
Operators Functions
'' " " "
%
Assignment operators
t =
* =
A reusable
= =
:
-
: .
block of code executes
, ,
particular task
.
a .
! =)
"
Comparison
Operators Equal to f- =) Not equal too ( :
When function doesn't accept any
,
Fun
Fyn
chin Name
on
hype function
a
Bitwise Operators And (& ) or (1) Xor ( ) Not Invert f)
n : ←
arguments void instead
•
use the
,
,
int 'tunction ( int ) argument , .
my year void also be used for functions
Logical Operations Logical And (ee ) (Il ) not ! can
{
:
Logical or
Logical
.
, ,
that don't return value place
any ,
in
The statement that performs of the return
type .
Digital Systems program Execution Flow
•
:
•
Micro Processors :
Chips that
require the
logic to Sequential Execution :
Step by step , top to bottom in
Interfaced with
order of how
they appear
execute a
program .
memory that
if Branching achieved else
else is
using if construct
- - '
--
an .
contains data and
programs
.
else is not
else if is a cascaded condition mandatory .
•
Micro Controllers Chips that combine
processor
: a
Nested if :
If . .
inside another condition is called
nesting .
with some
memory
and external interfaces on
single
die
Loops
used in embed ed function
-
.
Most loops are set to start on a
given condition ,
run
for a
specific
AND OR NOT time and then terminate .
A
Y A A Y
Y
While loops control into the loop block
B
entry
B
Y AB A B Y ft
-
loop block will
only
execute the block
if the check condition is
y
- -
-
= +
true .
Condition only checked at the start of the loop
A B Y A B Y A Y
do white checks the condition to the
loop code must be
get
- -
o o o o o • ,
O l .
O l O O l l run once .
I O O '
l O l l O
For loop -
checked at the start the loop loop controls
l l l
of
-
, i , ,
are
included in the loop definition .
C switch
programming
•
Switch statement check between
Header Includes the needed to be
for equality
an
integer and in
libary functions
:
program .
some cases labels and then executes the case that matches
Main function The the
is executed
by running the code
integer
:
program
.
this
in main
function
Indicates pointer
Body : Contains the instructions to be executed . Pointers type
I
' '
char t ;
g
-
-
*
Stages of
*
•
int char
compilation :
my
pointer ; p i
¥p&?
d H the
d
address of is
assigned to
p
Preprocessing Expands
g
I, bases
Macros &
type of
-
:
-
references Name of
.
H contains the
' '
g
now u
data
Compiling Compiles to assembly pointer
-
: -
to
pointed
Assembling Assembling the object file
-
:
Arrays A
char
gT-D://dedeah.cn of an
array
way of combining
.
Linking Links object files into executable
:
single
-
float f- LD 's 11
a A with 7 elements
.
float array
information of the same
type
{ 9111 declaring an
'
-5
'
'
4
'
char
Variables
'
referring to them
by y
-
and a .
,
array
by assignment
single variable
.
name
Each
Memory bytes byte ED 's 112nA Element
.
small containers of
of memory
int score
-
in score is
-
y
-
.
Array ED ;
to
int an assigned y
is
assigned a
unique member
indicating its location
*
( an 1)
char tic tac -63133 ;D 3rd row ,
3rd column .
Array + =3 ; Hsets the 2nd element
or address .
The address of the variable is the 't
in the
array
& an
int
Array ;
-
p
Strings
-
lowest An characters
number of It increases
array of
-
bytes
address 1
. ptt ; pointer by
Strings
*
2 ; 11 sets the 2nd element terminated If
-
p
-
in are
Expressions -
Combination
of operands and
operators that the
array .
char name LD -
-
{ '
j
'
.
a'
'
,
'
m
'
,
'
e' is
'
,
'
tf I
'
logical
make sense .
last Name D=
"
Cortex
"
Structures char
Operands -
a variable on a constant value
that has
Nogicat
action
Operator -
a mathematical struct is a C construct that arrows users to define their own
type of
to be
performed
on the operator .
combining several data types -
allows a
single reference to a complex format
Dot
operator ( ) to struct
o
used access member variable within the
Statements Statements end in
always semicolon; tells
:
a
more efficient way optimising memory use is to define the bit
-
of
the compiler that it is the end of an instruction .
length of member variables in struct
using bitfields
a () - :
" " " "
%
"
Operators Functions
'' " " "
%
Assignment operators
t =
* =
A reusable
= =
:
-
: .
block of code executes
, ,
particular task
.
a .
! =)
"
Comparison
Operators Equal to f- =) Not equal too ( :
When function doesn't accept any
,
Fun
Fyn
chin Name
on
hype function
a
Bitwise Operators And (& ) or (1) Xor ( ) Not Invert f)
n : ←
arguments void instead
•
use the
,
,
int 'tunction ( int ) argument , .
my year void also be used for functions
Logical Operations Logical And (ee ) (Il ) not ! can
{
:
Logical or
Logical
.
, ,
that don't return value place
any ,
in
The statement that performs of the return
type .