文本记录English

Registers and Counters

19m 19s3,690 字数596 segmentsEnglish

完整文本记录

0:01

so now that we have a pretty good idea

0:02

of how to build sequential devices

0:04

uh in a general description we can build

0:06

out a couple of standard sequential

0:08

devices that we will use when we build

0:10

our data path

0:11

uh this is just like in the

0:12

combinational logic section where we

0:14

built out a few

0:15

standard combinational logic devices

0:17

like multiplexers and decoders

0:19

here we're going to build registers and

0:22

then we're going to build

0:23

counters both of these are standard

0:24

devices that we will end up using

0:26

in our data path so a register is the

0:29

first one we'll build and it's a pretty

0:31

straightforward device the idea is to

0:33

store and be able to manipulate a

0:35

collection of

0:37

individual bits that are treated

0:39

together like a

0:40

word uh so a collection of bits that

0:43

represent the number

0:44

or some other piece of information and

0:47

the size of these registers is going to

0:48

dictate the

0:49

the sort of size of the data path of the

0:51

computer that we're going to build so a

0:53

32-bit computer has 32-bit chunks of

0:56

information passed around

0:58

as stored and retrieved in 32-bit

1:00

registers

1:01

a register is just a collection of these

1:03

bits so we're going to build a register

1:06

that is going to be able to store and

1:08

also

1:09

shift this is another function that

1:11

these registers often have

1:13

which allows us to move the information

1:15

on the register up or down by one bit

1:17

that has a particular functionality as

1:19

you'll see and then we'll build some

1:21

counters

1:21

we've built general purpose counters

1:23

already in our sequential design process

1:25

but we'll build a couple of

1:27

specific counters that just count

1:29

sequentially one two three four five

1:31

and you'll see that there are some

1:33

standard simplifications that we can

1:34

make in that process as well

1:37

so a register is just a collection it's

1:39

going to be a collection of d

1:40

flip flops because the d flip flop is

1:42

the flip flop that we use

1:44

when we want to just store a piece of

1:45

information we present at the input of

1:47

the flip flop

1:48

the information that we want to store

1:50

and then the design

1:51

process for a register is very

1:53

straightforward all we do

1:54

is present at the input of the d flip

1:57

flop and we use a multiplexer to

1:59

select what we're going to present at

2:01

the input of the d flip flop to store

2:03

what we want to store so we're going to

2:05

build one

2:07

slice of the register first we call this

2:08

a bit slice and this is just like when

2:10

we built the adders and subtractors

2:12

we built a slice of the device that will

2:14

handle one bit at a time

2:15

and then we expand that design to the

2:17

entire device so in this case we'll

2:19

build a single slice and this register

2:21

example that we're going to walk through

2:23

can do four different things

2:24

it can store the information it's

2:26

already there so make no change

2:29

it can shift the information left or

2:31

right and it can load new information

2:33

from the outside world

2:34

so let's have a look at what that looks

2:36

like so again we have a multiplexer

2:39

and we have a design principle that

2:41

we've used in the past

2:42

uh you know in other other programs the

2:46

multiplexer might sort of have a

2:47

different shape and we might have

2:49

the control lines out the side for

2:51

example but in the

2:53

logic works program it's just a box and

2:55

the control logic is right here

2:57

and then depending on the control inputs

3:00

one of four

3:01

possible data inputs are routed through

3:03

to the

3:04

data output of the multiplexer

3:07

and then that's just presented to the

3:08

input of our flip flop

3:11

now the four different functions that

3:13

this particular register will have

3:15

first of all we can load information in

3:17

from the outside world

3:18

that's for if the control logic is set

3:21

to three

3:22

if the control logic is set to one or

3:25

two

3:26

then we might shift and that means that

3:28

we'll bring information for this

3:30

particular slice

3:30

from the left to or sorry from the right

3:34

if we're shifting left

3:35

or from the left if we're shifting right

3:38

and we'll see how that works once we

3:40

stack the bit slices together

3:42

and then the last function is just to

3:44

store the current value

3:46

now this is something that people

3:47

sometimes get confused about because the

3:49

flip flop

3:50

generally has this storage procedure

3:52

already built in why do we need a

3:53

multiplexer to do it

3:55

well the storage process for a d flip

3:58

flop relies on the clock to be either

4:00

high or low

4:01

and we really want the clock to be

4:02

synchronized across all of these devices

4:04

we want every device in our machine to

4:06

be on the same clock

4:07

so we don't really want to modify that

4:09

clock very much we're going to have that

4:10

clock just be

4:11

its value so instead what we're going to

4:13

do is take the current value that's

4:15

stored in the flip-flop and we're going

4:18

to route it back

4:19

and present it as one input to the

4:21

multiplexer

4:22

and then if that's the function that we

4:23

choose then that value gets routed

4:25

through and presented back at the input

4:27

again

4:28

and to store then information we just

4:31

store that information around and around

4:32

and it just sort of reinforces that same

4:35

value whatever it is back again at the

4:38

input of the

4:38

d flip flop for this particular bit

4:40

slice so if we're going to

4:42

put a few of these together it looks

4:44

like this

4:46

each individual slice can take

4:48

information

4:49

in its multiplexer inputs from the

4:52

current value

4:53

for d0 it can take information from

4:57

the slice to the right if we're going to

5:00

be shifting to the left

5:02

it can take information from the slice

5:04

to the left if it's going to be shifting

5:06

to the right

5:08

and it can take information from the

5:10

outside world

5:11

in a load so those are the four

5:13

different things that each bit slice can

5:14

do

5:15

and you can see that if you ask this

5:16

register to shift a value one bit to the

5:19

right

5:19

then each um each

5:22

flip-flop will take a value from the

5:25

multiplexer that is routed

5:27

from the previous flip-flop and they

5:29

will just go one to the next oops that's

5:31

not right

5:32

one to the next one to the next and the

5:34

whole value will just be shifted one bit

5:37

to the right and the same for the left

5:40

if you're

5:40

going the other direction it will shift

5:41

one bit to the left now when we shift to

5:43

the right

5:44

we have to make a decision as to what to

5:46

do to this top bit

5:47

because there's no value to shift in so

5:49

we have to have an

5:50

input from the outside world that we'll

5:52

bring in and usually we just shift a

5:54

zero

5:54

in because it's simpler and the same

5:56

thing for the left if we're shifting

5:58

from

5:58

the shifting to the left we have to

6:00

evaluate the lower bit

6:02

to shift some value in uh this does

6:05

bring up the question of what actually

解锁更多

免费注册以访问高级功能

互动查看器

观看带有同步字幕、可调节叠加层和完整播放控制的视频。

免费注册以解锁

AI 摘要

获取由 AI 立即生成的视频内容摘要、要点和结论。

免费注册以解锁

翻译

一键将字幕翻译成 100 多种语言。以任何格式下载。

免费注册以解锁

思维导图

将字幕可视化为交互式思维导图。一目了然地了解结构。

免费注册以解锁

与字幕聊天

提出关于视频内容的问题。直接从字幕中获取由 AI 驱动的答案。

免费注册以解锁

从您的字幕中获得更多

免费注册并解锁交互式查看器、AI 摘要、翻译、思维导图等。无需信用卡。

    Registers and Counters - 完整文字记录 | YouTubeTranscript.dev