﻿1
00:00:12,820 --> 00:00:16,040
Well sign the initial values in VHDL.

2
00:00:16,150 --> 00:00:20,140
Are a few examples we can look at to show you how that is done.

3
00:00:20,140 --> 00:00:22,980
So first for line number one.

4
00:00:22,990 --> 00:00:28,870
Just a quick comment to showing you that in your dash dash your comment and your work you know notepad

5
00:00:28,870 --> 00:00:35,130
plus plus as you put the dash dash there you'll notice that your text or anything and type turns green.

6
00:00:35,530 --> 00:00:42,040
So it's pretty neat that when you type a key word and no Paphos Plus how is it what you know that it

7
00:00:42,040 --> 00:00:45,180
recognizes that it's a VHDL file.

8
00:00:45,190 --> 00:00:52,350
So we go ahead and type a type signal in here which is a key word and VHDL and you see this is this.

9
00:00:52,470 --> 00:00:58,690
As soon as I start to type it it shows up there in the dropdown I go and hit enter and then it turns

10
00:00:58,690 --> 00:01:02,300
blue and Kate knows that that's a signal.

11
00:01:02,380 --> 00:01:07,210
And so is the quick way to bet if you're using the Apply Plus plus a key thing to remember if you're

12
00:01:07,300 --> 00:01:14,890
editing a file in Notepad plus plus when you if you go to a file you go ahead and create a new file

13
00:01:15,340 --> 00:01:18,070
and it's going to right away.

14
00:01:18,470 --> 00:01:21,030
It is called a normal text file.

15
00:01:21,070 --> 00:01:26,830
Want to click on language go down to be like VHDL.

16
00:01:26,950 --> 00:01:30,920
Now it will call it the age as I see Hurlburt a script of mine which file.

17
00:01:31,120 --> 00:01:37,130
So now if I type it will pick up signal because I know that that's the key word enter.

18
00:01:37,320 --> 00:01:41,190
It makes it blude indicate that that's a key word.

19
00:01:41,260 --> 00:01:45,060
I'm not going to keep this almanacks of that.

20
00:01:45,220 --> 00:01:47,880
So I will go to our back to our example here.

21
00:01:48,100 --> 00:01:56,470
And so first I have signal A which is a type of integer and I want to give an initial value of 4.

22
00:01:56,740 --> 00:02:07,210
So I have my signal a then I have to do a semi-colon there to a colon to indicate that my data type

23
00:02:07,210 --> 00:02:11,190
which is in the keyword which you notice is is purple.

24
00:02:11,380 --> 00:02:14,510
And then I'll give it a colon equals four.

25
00:02:14,530 --> 00:02:20,530
So what this is doing is I'm saying I have a signal I'm calling it a.

26
00:02:20,710 --> 00:02:25,450
It has an integer type integer an initial value of.

27
00:02:25,840 --> 00:02:31,100
If we move down to three on line with a mindset and we have signal B and.

28
00:02:31,240 --> 00:02:39,040
And do you mean this is a type unsigned with an initial value of 0 0 0 0 because we work with unsigned

29
00:02:39,040 --> 00:02:39,900
and signed.

30
00:02:40,030 --> 00:02:46,960
We have to give it the actual bit values because an integer we can't give it like a 1 or 0 or so on

31
00:02:46,960 --> 00:02:48,270
and so forth.

32
00:02:48,270 --> 00:02:56,950
And so if you look I have signal B my colon indicates the data type unsigned and I give you the keywords

33
00:02:57,000 --> 00:03:05,200
3 down to zero which just means I have an unsigned data type of 4 bits and if you look then I have a

34
00:03:05,200 --> 00:03:11,140
colon equals which I'm going to have the double parentheses which just indicates all the bits.

35
00:03:11,140 --> 00:03:14,350
So it's giving an actually signal B is four bits.

36
00:03:14,350 --> 00:03:22,870
All of them are initialized to zero and B one if you look on line 10 is doing the exact same thing except

37
00:03:22,870 --> 00:03:28,870
we're using the other's key word message to show you you initialize with larger values that you can

38
00:03:28,870 --> 00:03:34,190
see that instead of if I would have liked this is only forbit.

39
00:03:34,200 --> 00:03:35,980
So it's not as big of an issue.

40
00:03:36,040 --> 00:03:45,640
But if this were to be I don't know like a 12 or 24 32 ribbon 64 bit signal instead of putting in 64

41
00:03:45,640 --> 00:03:46,690
zeros in my file.

42
00:03:46,690 --> 00:03:48,060
I can just have this other.

43
00:03:48,280 --> 00:03:55,860
And the zeros there and that keyword will actually initialize a signal be 4 bits wide all with zero.

44
00:03:56,370 --> 00:04:06,700
And if you look down on lines 18 21 with my signal C and C 1 we're doing the exact same thing except

45
00:04:06,700 --> 00:04:17,410
that we're working with these are actually signed values which I have as unsigned because OK I can just

46
00:04:17,410 --> 00:04:23,530
go ahead and read that down to see one on line 21 and move on.

47
00:04:23,530 --> 00:04:33,490
So now signal C and C 1 are doing the same thing as signal B and B one except there sign two types as

48
00:04:33,490 --> 00:04:34,660
opposed unsigned.

49
00:04:34,960 --> 00:04:41,530
And we initialize them in the same way we use the colon equals and give it the value y initialize it

50
00:04:41,530 --> 00:04:45,440
to move down.

51
00:04:45,660 --> 00:04:50,090
Let's look at signing initial values to standard logic sectors.

52
00:04:50,250 --> 00:04:59,400
So we have a signal looking on line 31 we wanted to fine signal a signal and name a as a standard logic

53
00:04:59,400 --> 00:05:06,780
vector data type with an initial value of all ones and count them not there but there's eight ones.

54
00:05:06,780 --> 00:05:08,220
So what we'll do.

55
00:05:08,370 --> 00:05:16,620
We want to put the key signal and type a and have a colon then put the data type which is a standard

56
00:05:16,620 --> 00:05:25,110
logic vector with underscores between the standard logic and the logic and vector and then have 7 down

57
00:05:25,110 --> 00:05:32,850
to zero which indicates that we have 8 bits from 7 0 and colon equals the others.

58
00:05:32,850 --> 00:05:36,310
It was arrow and put one in parentheses.

59
00:05:36,510 --> 00:05:43,650
Well that's going to do is give us a signal a bit hyped and logic vector 8 bits wide and all the values

60
00:05:43,680 --> 00:05:53,040
will be equal to 1 and we're doing the same with the signal we're going to call red saw the score range.

61
00:05:53,100 --> 00:05:59,600
Now we have a red edge and we want to give the initial value of 0.

62
00:05:59,790 --> 00:06:06,420
So we're going to have to signal signal a signal a red a red is going to be the same exact size same

63
00:06:06,420 --> 00:06:10,640
data type standard logic vector over a red nose.

64
00:06:10,710 --> 00:06:11,760
It has a 1.

65
00:06:11,760 --> 00:06:14,130
We want to make it initial value of all zeroes.

66
00:06:14,130 --> 00:06:20,360
So I have to do is on the one backspace Weiss's zero in there.

67
00:06:20,400 --> 00:06:27,060
So now we have signal a of 8 bits all ones signal A-rag that's all zeros.

68
00:06:27,320 --> 00:06:30,620
And made a little note in here just to kind of show you this is correct.

69
00:06:30,990 --> 00:06:33,090
So I wanted to take.

70
00:06:33,110 --> 00:06:40,360
They make it equal to a red edge and or that I just type the arrow equals.

71
00:06:40,500 --> 00:06:43,290
So and this is a concurrent statement.

72
00:06:43,290 --> 00:06:50,070
So always were were saying that our signal a red edge is being kept the same way.

73
00:06:50,100 --> 00:06:58,550
A lot of times you'll do this when you have to not have two signals but when you have a signal but it's

74
00:06:58,660 --> 00:07:02,650
like of a with an output on the port map it has a red edge.

75
00:07:02,700 --> 00:07:05,150
So you can write values into this registry.

76
00:07:05,330 --> 00:07:08,320
And then the map too.

77
00:07:09,510 --> 00:07:18,600
So if you know after this point of her 1:42 our signal is equal to all zeros and way red equals it's

78
00:07:19,770 --> 00:07:26,660
quick little example showing you how to initialize values and HGL and give them some meaning.

