1
00:00:00,570 --> 00:00:01,490
Hello fellas.

2
00:00:01,560 --> 00:00:02,230
Welcome back.

3
00:00:02,850 --> 00:00:09,450
So in this lesson we shall look at another essential components of the embedded system the memory an

4
00:00:09,450 --> 00:00:14,070
embedded system has to have some form of memory to store and execute code.

5
00:00:14,610 --> 00:00:21,540
And when we look up memory we can compare them in terms of price performance and power consumption.

6
00:00:21,540 --> 00:00:28,350
For instance if a memory has to run twice as fast to maintain desired bond with the memory power consumption

7
00:00:28,350 --> 00:00:30,060
requirements may be higher.

8
00:00:30,060 --> 00:00:33,120
This curve depicts the the memory hierarchy.

9
00:00:33,450 --> 00:00:39,000
First you must know that all computer systems have memory arranged in some form of hierarchy.

10
00:00:39,000 --> 00:00:40,630
This graph shows the arm.

11
00:00:40,910 --> 00:00:48,090
The memory trade of the fastest memory is the cache memory and is physically located nearer to the process

12
00:00:48,090 --> 00:00:56,430
of call and the slowest memory system is the secondary storage which is set further away from the processor.

13
00:00:56,460 --> 00:01:03,180
Generally speaking the closer the memory is to the process all the more its costs and the smaller its

14
00:01:03,180 --> 00:01:10,680
capacity the cache is placed between the main memory and the call and its use to speed up data transfer

15
00:01:10,680 --> 00:01:16,320
between the process all and the main memory which all week some into cash on its own later but for now

16
00:01:16,320 --> 00:01:22,860
you only need to remember that the cash provides an overall increase in performance and it comes with

17
00:01:22,860 --> 00:01:26,140
a loss of predictable execution time though.

18
00:01:26,690 --> 00:01:34,940
And this only becomes a problem when when you do it in a real time application the main memory is large.

19
00:01:35,280 --> 00:01:43,860
It's in it's an megabytes mostly and sometimes even an gigabyte depending on the application and and

20
00:01:43,860 --> 00:01:52,890
it may memory is generally a separate chip from the from the process so as we shall see later load and

21
00:01:52,890 --> 00:02:01,590
store instructions access the main memory unless the value have been stored into cash for fast access.

22
00:02:01,590 --> 00:02:08,300
You can think of the young secondary memory as your everyday flash disc your hard disk or your seedy

23
00:02:08,300 --> 00:02:09,160
rom.

24
00:02:09,180 --> 00:02:14,430
Now let's take a look at some parameters we pay attention to when looking up memory.

25
00:02:14,430 --> 00:02:20,850
So let's start with the memory with the memory with is basically the number of bits the memory returns

26
00:02:20,880 --> 00:02:30,660
on each on each access and it comes in the sizes of 16 bit 32 bits and 64 bit memory with us direct

27
00:02:30,750 --> 00:02:33,130
effect on overall performance.

28
00:02:33,150 --> 00:02:42,090
For instance if you have a system without cash memory using 32 bit instructions and 16 bits wide memory

29
00:02:42,090 --> 00:02:50,430
chips to process or have to make to memory fetches pet instruction because each fetch can only carry

30
00:02:50,430 --> 00:02:51,860
sixteen bits load.

31
00:02:52,140 --> 00:02:58,830
This of course has the effect of reducing the system performance but the upside is sixteen bits memory

32
00:02:58,830 --> 00:03:00,510
is less expensive.

33
00:03:00,600 --> 00:03:08,820
In contrast if the call executed 16 bit thumb instructions it will achieve better up to four months

34
00:03:08,850 --> 00:03:15,600
with a sixteen bits memory because the call will make a single fetch to memory to load an instruction

35
00:03:16,120 --> 00:03:17,360
as we shall see in this course.

36
00:03:17,370 --> 00:03:24,690
The ARM processor is capable of executing three instruction sets the instruction sets which has 32 bit

37
00:03:24,690 --> 00:03:31,020
instructions the thumb instruction sets which are sixteen bits instructions and a thumb to instruction

38
00:03:31,020 --> 00:03:35,930
sets which uses both sixteen bits and sets two bits instructions.

39
00:03:36,480 --> 00:03:45,870
Let's see how the arm and thumb instructions compare when using different memory with the ARM instruction

40
00:03:46,890 --> 00:03:50,850
the ARM instruction set is that two bits in size like we mentioned.

41
00:03:50,850 --> 00:03:58,890
So if they're with off the memory is 8 bits the processor would need four cycles to fetch a single instruction

42
00:03:59,990 --> 00:04:06,250
if the width of the memory is 16 bits the process will require two cycles better instruction.

43
00:04:06,470 --> 00:04:14,320
And if the width of the memory is 32 bits then the process will require a single cycle pair instruction.

44
00:04:14,600 --> 00:04:21,020
On the other hand the instruction set has instructions with 16 bits of size.

45
00:04:21,050 --> 00:04:27,800
Therefore we turn 8 bits memory with the process eight uses two cycles to fetch a single instruction

46
00:04:28,330 --> 00:04:34,880
and we have sixteen bits memory with the process or will require a single cycle to fetch a single instruction

47
00:04:35,320 --> 00:04:42,730
with a 32 bit memory with the process will still require a single cycle to fetch a single instruction.

48
00:04:42,740 --> 00:04:51,850
Now let's take a look at some of the commonly used memory types we would find in embedded devices.

49
00:04:51,850 --> 00:04:59,010
The room cannot be reprogrammed and the flush room is a type of from that can return to as well as read

50
00:04:59,510 --> 00:05:04,480
but it is slow to write too so it's not used for hold in dynamic data.

51
00:05:04,670 --> 00:05:12,210
Its main uses for holding the device firm were storing long term data that needs to be preserved.

52
00:05:12,260 --> 00:05:20,890
After the power is off the dynamic random access memory is the most commonly used type of Rob for devices.

53
00:05:20,960 --> 00:05:27,920
It has the lowest cost per megabyte compared with other types of firearm the s ROM which stands for

54
00:05:27,920 --> 00:05:36,620
static random access memory is faster than D D ROM its access time is considerably shorter than the

55
00:05:36,620 --> 00:05:43,970
equivalent do run because s run does not require pauses between data access the SD Iran is a subcategory

56
00:05:43,970 --> 00:05:49,520
of the RAM and it is capable of running at fast faster clock frequencies.

57
00:05:49,520 --> 00:05:58,090
The EP from which stands for the electrically reasonable programmable read only memory is used for program

58
00:05:58,100 --> 00:06:02,530
cold storage most often for saving critical data.

59
00:06:02,750 --> 00:06:06,430
Not all ARM chips have an on chip approach.

60
00:06:06,440 --> 00:06:13,340
Now let's look at a simplified memory space allocation diagram for an armed device typically has four

61
00:06:13,340 --> 00:06:17,170
gigabytes of directly accessible memory space.

62
00:06:17,170 --> 00:06:18,120
Now why is that.

63
00:06:18,740 --> 00:06:26,700
Remember cause it two bits course and you are fit two bits cause because the internal registers of that

64
00:06:26,710 --> 00:06:33,260
two bits the data paths out there's two bits and a boss interfaces off it to bits.

65
00:06:33,590 --> 00:06:42,530
The bits size allows the CPSU to address a memory for an individual a process so an expert can handle

66
00:06:42,560 --> 00:06:48,120
two to the power X byte of memory the higher the bid size the higher the performance.

67
00:06:48,200 --> 00:06:54,350
Therefore a 32 bit can handle approximately 40 get byte of memory.

68
00:06:54,440 --> 00:06:58,900
The memory space can be divided into five sections.

69
00:06:59,120 --> 00:07:05,900
The ownership pair for an eye or register section which can occupy any of the empty areas here.

70
00:07:05,900 --> 00:07:13,220
Depending on the particular silicon manufacturer the s room section which is used for the data variables

71
00:07:13,310 --> 00:07:21,740
and stack the EP section and the Flash section the SFR section indicated up here is for special function

72
00:07:21,740 --> 00:07:22,790
registers.

73
00:07:22,790 --> 00:07:27,250
We should talk about the arm the arm registers in sections.

74
00:07:27,380 --> 00:07:29,310
So this is all there is to it.

75
00:07:29,330 --> 00:07:37,820
To summarize the s Rom is used by the CPI for data variables and stock whereas the EP roms are considered

76
00:07:37,820 --> 00:07:38,820
to be the memory.

77
00:07:38,850 --> 00:07:46,640
You can add externally to the chip the flash from is useful program code while the apron is used most

78
00:07:46,730 --> 00:07:53,060
often for critical system data that must not be lost if power is cut to the system.

79
00:07:53,060 --> 00:07:56,900
This all there is to it and I'll see you in the next lesson.
