Тёмный

Hardware build: CRC calculation 

Ben Eater
Подписаться 1,3 млн
Просмотров 470 тыс.
50% 1

CRC (cyclic redundancy check) involves some intimidating math. But it turns out that it can all be done with some fairly simple hardware. In this video, I build the hardware to compute and verify CRCs. Previous video on CRC theory is here: • How do CRCs work?
Code from this video: github.com/ben...
Support these videos on Patreon: / beneater or eater.net/support for other ways to support.
------------------
Social media:
Website: www.eater.net
Twitter: / ben_eater
Patreon: / beneater
Reddit: / beneater
Special thanks to these supporters for making this video possible:
Ben Dyson
Ben Kamens
Ben Williams
Brandon Stranzl
Christopher Blackmon
Debilu Krastas
Eric Dynowski
Gonzalo Belascuen
Jay Binks
Jayne Gabriele
Johnathan Roatch
Jordan Scales
Manne Moquist
Mark
Michael Burke
Mirko Rener
Nicholas Moresco
Nick Wrightsman
Old Lion
Randy True
Ric Allinson
Robert Butler
Sachin Chitale
SonOfSofaman

Опубликовано:

 

29 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 525   
@benjaminmyburgh6936
@benjaminmyburgh6936 5 лет назад
Watching that complex math boil down to such simple logic operations was the most beautiful thing I ever saw
@marshmellominiapple
@marshmellominiapple 5 лет назад
it's really all math, understanding it what makes it beautiful
@bonbonpony
@bonbonpony 5 лет назад
Have you seen the punchline at the end though? (51:44) ;)
@CMDRunematti
@CMDRunematti 3 года назад
you should look into 3blue1brown channel
@malcolmholmes115
@malcolmholmes115 3 года назад
I feel so sad that his channel is so underrated, but really crappy videos is really popular, bit disappointed in humanity
@toquelau5715
@toquelau5715 2 года назад
@@malcolmholmes115 Have you seen the movie 'Idiocracy'? Sadly, that's the world we're heading into. Easy and dumb trumping over smart and creative. Looks over substance. The intelligent are becoming a rare bunch...
@richardwilliamjohnson8566
@richardwilliamjohnson8566 5 лет назад
Dude. Do you realise how fucking amazing it is to see maths being used for something useful? Maths teachers can never tell you why you're doing what you're doing. It's just dull processes you memorise to pass a test. What a joy it is to see this!! Thanks
@ricardoboss
@ricardoboss 5 лет назад
Just wanted to say that I'm glad you're making videos again! Love all of them!
@ashwani2910
@ashwani2910 4 года назад
Just amazing!!! I have never seen an complex topic been explained with such simplicity. I read about CRC during my college days but never understood it. Now after 15 years finally I am able to. Thanks a lot sir Ben.
@heidelbergcellularrepairs8638
@heidelbergcellularrepairs8638 2 года назад
This guy is awesome. How he divides all complicated systems to their simplest logic is marvellous
@micycle8778
@micycle8778 4 года назад
One thing I would add here is a "CRC" line. When it's held high, whatever system you have for reading the output would be disabled and the only thing that would read data would be the CRC logic. With that, you could also make a basic frame. On the falling edge of the CRC line, you know a frame has ended and a new frame will begin in some time.
@ulysses_grant
@ulysses_grant 5 лет назад
Man, it's a real joy to see you uploading again... Thank you Ben!
@cokeforever
@cokeforever 5 лет назад
Your channel is of very very high quality. I do project lead for living and the more i go thru life, the more i dream younger programmers be taught at least one-year course by you ) Logic and sense of it is what you do really well, and it is great ground to stand on for each programmer. Thank you for your videos and good luck, sir!
@Abhinav-tk1bt
@Abhinav-tk1bt 5 лет назад
Always a delight when you upload!
@P37R1X
@P37R1X 4 года назад
What an awesome video, although I have to admint this complex math really hurts my brain. I REALLY appreciate this hardware version, seeing the LEDs themselves represent the values and corresponding to the computing/computed value in bits was simply AWESOME. It really did explain a lot.
@bharadwaj297
@bharadwaj297 11 месяцев назад
I have been working on ethernet for 8 years. And written crc computation functions.. but this is truly amazing.
@KuraIthys
@KuraIthys 5 лет назад
So... What you're talking about is pretty similar to how you do integer division on computers that don't have hardware divide/multiply functions. Division is harder to understand than multiplication, but it still comes down to repeated application of shifts and subtraction. The algorithm for a shift + subtraction version of division looks something like this: - Shift the 2nd number (divisor) to the left one bit at a time, until you reach a 1, which means you've shifted far enough. - Along the way, count how many shifts you did to get here. (depending on how your hardware handles loops, maybe add one more, maybe not) - now loop through as many times as you just counted. Each time you shift the left-hand bit out of the 2nd number (divisor). If it's a 1, you subtract the 1st number (Dividend) from the result, and count up by one (typically you need to store a working value for the result, and working values for both the 1st and 2nd number - unless you can safely use the input values directly for this), if it's a zero, you do nothing. - Then you shift the 1st number (Dividend) right by one position, and continue until you've gone through everything. - your result, since this is integer division consists of the integer portion, and the remainder. The integer portion is the count of how many subtractions were performed, the remained is your working value. I've probably made some kind of logical error here, but since I'm working from memory, I'll leave it alone. Hopefully you get the general idea.
@mistervoldemort7540
@mistervoldemort7540 Год назад
This educational content is just out of this world !
@willofirony
@willofirony 5 лет назад
Junk Mail says it all.... or rather he doesn't say it .... which is the appropriate response when one is in awe. Oh, I am 68. These videos on parity/CRC have left one seriously considering throwing away the PC and buying a crate load of 7400 chips to construct a circuit for each and every algorithm. Such a change from C++!
@SyedRizvii
@SyedRizvii 5 лет назад
Great stuff there Ben, each second was captivating and kept me thinking with all this grade and money making race a lot of top tier institutes are failing to teach all this. Would love to see an FPGA implementation of this...keep it coming sir!
@edgeeffect
@edgeeffect 5 лет назад
That's cool! I've done OR gates with diode logic but never known how and AND wold be done.... thanks for that.
@hydroxacte
@hydroxacte 5 лет назад
Possibly add a little info to the description about who INVENTED the CRC (en.wikipedia.org/wiki/W._Wesley_Peterson). I mean, hats off to the guy who figured this out from first principles!
@Thect
@Thect 5 лет назад
Me: That's a simple circuit, maybe I can try to make one Ben:(Math math math math math math) Me: Okay I give up
@AMADANON
@AMADANON 2 года назад
Hi Ben & viewers, Just a quick heads-up - the website you went to no longer returns the same CRC as it did in your video. The parameters for CRC-16/XMODEM are still the same, so I can only assume that at some point a bug was introduced. I spent a long time comparing my code to yours, only to find out they were exactly the same, and gave the same answer.
@BeachCity
@BeachCity 5 лет назад
Your Arduino may have wanted to initialize the flip flops in the shift register to 16 0's on the transmitting and receiving end prior to sending or receiving the message and you wouldn't need to constantly manually reset the registers with a wire. This would have been a simple init loop identical to the one which was used to set the last 16 bits to zero when you began the video. Doing this would have made it easy to fill different patterns into the register and test CRC variants where only the shift register seed is non-zero. Zapping to zero manually as you have done precluded an easy demonstration of various seed alternatives.
@6LordMortus9
@6LordMortus9 5 лет назад
I haven't seen XMODEM since the BBS days :)
@QDWhite
@QDWhite 4 года назад
This algorithm is genius! People who can imagine solutions this eloquent should be knighted.
@timetraveler7
@timetraveler7 4 года назад
Right? It's hard enough to learn but someone figured this out, like how, how did they do it!
@nathanglevy
@nathanglevy 5 лет назад
I love your videos, and I'm glad you started making some again :) Thank you!
@brucewilliams6292
@brucewilliams6292 5 лет назад
God, I think I actually understand this! Well done as always!
@milapravda3916
@milapravda3916 3 года назад
Very much inspiring! Thank you.
@chaitanyasindagi1237
@chaitanyasindagi1237 5 лет назад
You could've used an or gate that ORs the output of the Arduino and the CRC checker, instead of using additional data lines. It would have the additional benefit of resetting the crc calculator. The AND gate to disable the calculator seems unavoidable though
@TimothyChapman
@TimothyChapman 5 лет назад
RU-vid didn't tell me you had a new video.
@SystemScientist
@SystemScientist Год назад
Fantastic video
@ThingsWhichArentWork
@ThingsWhichArentWork 5 лет назад
Thank you for your brilliant videos. Cheers!!
@ericwalls7717
@ericwalls7717 5 лет назад
Sounds like somebody got a new keyboard!
@plazmotech5969
@plazmotech5969 5 лет назад
This is so good! Thank you Ben!
@ahmatrizki5154
@ahmatrizki5154 3 года назад
I don't know, i much understand practice than theory, thank you
@belkida
@belkida 5 лет назад
Love this video! Did you forget to list the diodes in the hardware list?
@Catalin227
@Catalin227 4 года назад
Did you figure out what kind of diodes he was using?
@jayakrishnanharikumaran3758
Thanks a lot for this video. How does this logic translate to the lookup table method calculation of crc? It is not clear how xoring the new data with the crc gives us the index for the lookup table with the new crc value.
@hCryM
@hCryM 3 года назад
So beautiful .
@thesparksplug
@thesparksplug 4 года назад
Where were you when I was doing my Electronics studies. I feel like I want to redo my BSc.
@randycarter2001
@randycarter2001 2 года назад
I would have taken a spare output to automatically clear the register at program start.
@ropersonline
@ropersonline 3 года назад
The "looks like we're doing a bunch of subtractions" at 3:05 confused me. As you also mention later, these are XORs, not subtractions. 010010000110100100 - 10001000000100001 would equal ----------------------------------- 00001000110000011 which is not the same as 010010000110100100 ^10001000000100001, which would equal ----------------------------------- 00011000110000101 So I'm not sure I really get it. Why is it you say subtractions? EDIT: Is that related to what you said at 20m50s in your earlier "How do CRCs work?" video? And to what you said there at 24m38s, etc.?
@TonyLatta
@TonyLatta 4 года назад
A little late to the game here, but was re-watching this and it occurred to me if you XOR'd every flip-flop and AND'd between the flip-flop 16 out and the XOR in, with the AND input 1 being Flip-Flop output and input 2 being controlled by code, you could have the hardware support any generator polynomial of the same CRC length. Is something similar to this built into chips with the firmware controlling (or exposing to code) the generator polynomial?
@darrenhersey9794
@darrenhersey9794 3 года назад
Sorry, but was there a reason to not use the fourth xor gate to toggle read mode of the crc circuit?
@levimays55
@levimays55 3 года назад
On paper, t(x) is supposed to be m(x) - (m(x)modg(x)), but your hardware seems to use t(x) = m(x) + (m(x)modg(x)). Why the discrepancy? And why does your circuit still work?
@basvisscher934
@basvisscher934 3 года назад
Hey man, why don't you just OR the output of the Arduino and the CRC and send that to the receiver? The Arduino output is low during the CRC transmission and the CRC output is low during the data transmission. That would simplify things.
@jetraid
@jetraid 5 лет назад
Totally awesome
@HolarMusic
@HolarMusic 3 года назад
5:08 "So this x^35 got flipped off" can relate
@BigDaddy_MRI
@BigDaddy_MRI 5 лет назад
I have to admit, after 42 years being a MSEE, your videos are truly works of inspiration. You are, most likely, one of the very best in the explanation in hardware and software of complex systems and how they work. Your simplification of concepts is just perfect. Thank you for all your videos. Please continue with these videos. I look forward to each and every one.
@BillDreisbach
@BillDreisbach 4 года назад
Amen! (I'm in the same 'boat' ;-)
@MrCool-lo3ls
@MrCool-lo3ls 4 года назад
As a 17 year old student who goes to a school, that doesn't really teach technical stuff and electonics, i absolutely love his videos. He explains these concepts, shows how they work and how he sets them up. When people talk about electronics, they often show oversimplified images, that don't really translate to the real world. I watch this in my free time because I'm genuinely interested in the content, so I don't mind if the explanation takes a while, which is weird because my attention span is usually extremely short. From the way he explains these topics, they become understandable but he also gets across how complex they are and after watching his videos, I feel a bit smarter because i just learned something complex. I live in germany, and technology wise, we aren't that advanced. In schools it's a miracle if we get the projector to work. I don't think any students at my school who can programm, learned it in class. At least not the 5 who do know programming.
@junkmail4613
@junkmail4613 5 лет назад
I'm 70. Refreshing AND Breath-Taking..... Oh wait, I still need that.... :-) Thank You So much I can't verbalize it. Keep it up!
@shinigamilee5915
@shinigamilee5915 5 лет назад
It's a refreshers course. I used a similar method when testing CRC NAND flash drive testing. It's been about 5 years. It's surprising how much you forget.
@cogwheel42
@cogwheel42 5 лет назад
"Hella, world!" ... could not have planned that
@kmacdough
@kmacdough 4 года назад
This whole series was just an elaborate setup ;)
@abcrtzyn
@abcrtzyn 4 года назад
It actually happened in a previous video too
@Starwort
@Starwort 4 года назад
@@abcrtzyn IMO should have been Hella, word!
@techleontius9161
@techleontius9161 4 года назад
2019: "Hello, world!" 2020: "Hella world!"
@stevewalston7089
@stevewalston7089 5 лет назад
Absolutely awesome series Ben! This is the way electronics and engineering basics should be in college, breadboarding at its finest with detailed explanation all rolled into a practical example. What a world of difference this could make for the engineer to be that so rarely occurs when in school. I love it, and I haven't had digital classes since 1985! Tip for the kiddies: keep your breadboards on a 2D plane and try not to go full 3D …
@xamael1989
@xamael1989 5 лет назад
Well noted sir
@GRBtutorials
@GRBtutorials 5 лет назад
But 3D NAND is all the craze, why can't I do the same and use all the space available on my breadboard? Now seriously, I plead guilty to all charges... my breadboards are a mess.
@edmund-osborne
@edmund-osborne 5 лет назад
20:18 This reveal was amazing, seeing the circuit and suddenly realising how elegantly it implements the algorithm. Nicely edited!
@BrosBrothersLP
@BrosBrothersLP 5 лет назад
Well as far as i am informed the circuit was kinda there before people started doing it in software
@alpyre
@alpyre 5 лет назад
It would take a couple of days (if not weeks) of re-reading from whitepapers (or books) for me to grasp what CRC is. But in less than an hour, now I have a solid understanding of what it is, how it works, how it can be implemented. And I'm entertained all the way through. If only every college had at least one teacher like you, world would be a different place! :)
@m.sierra5258
@m.sierra5258 5 лет назад
Hey! I was just playing around with the CRC generation and found a simpler and faster way that eliminates sending 16 zeroes into the crc generator. What you did was: 1. initialize with zero 2. feed message[i] into the right side 3. crc-flip based on crc[leftmost] 4. repeat until message over, then feed 16 zeros If you replace that algorithm with: 1. initialize with zero 2. feed 0 into the right side 3. crc-flip based on crc[leftmost] xor message[i] 4. repeat until message over, done. no 16 zeros needed. This works because you basically skip the 16 first steps of your algorithm, which only fill up the pipeline without any bit flipping. You could bypass that step. The message itself doesn't have to get fed through the pipeline. This has the advantage that there is no waiting time between the message and the crc sending, after sending the message you can directly send the crc. Love your videos, keep making them!
@BenEater
@BenEater 5 лет назад
Nice improvement!
@xamael1989
@xamael1989 5 лет назад
Thanks alot can you be kind enough to share this on github
@chaitanyasindagi1237
@chaitanyasindagi1237 5 лет назад
Well, unless the CRC is calculated as you transmit like in this case and then your CRC is ready when the message is complete
@lyingcat9022
@lyingcat9022 5 лет назад
I’m trying to picture what this optimization looks like... but I cannot:( I don’t understand the difference in the steps. I completely follow his original though.
@lyingcat9022
@lyingcat9022 5 лет назад
Why init with zeros then shift in a zero?
@UpcycleElectronics
@UpcycleElectronics 5 лет назад
IMO it would take a few attempts at making public content for a person to appreciate the weeks of time and effort you've put into this. I don't care how long it takes you to upload something new. Your results are amazing, relevant, and timeless. The only thing that should change is how YT categorizes this channel's content. This is relevant to everyone interested in learning electronics, and it will never become dated. These fundamental core concepts will be just as important decades from now as they were decades ago. No one does a better job of breaking up these concepts to create intuitive and easy to follow lessons anyone can appreciate. I'm sorry that I feel like I need to watch these uploads with my full undivided attention. This usually means I watch an upload in parts over the course of a day or two. I doubt YT compensates for viewer metrics like this. I'm even worse about skipping around within a video while building some of these circuits myself. I imagine people like myself cause the channel viewer's statistics on the back end to look a bit screwy. I just wanted to say, those numbers are probably not a real indication of how some of us are watching :-) I hope you enjoy doing these and can keep them coming for as long as possible. You're a real inspiration, and a talented teacher. Many thanks. -Jake
@wrappeda
@wrappeda 3 года назад
Perhaps YT needs a "42" classification... If "42" isn't a familiar concept, ask the internet. :-)
@luizzeroxis
@luizzeroxis 5 лет назад
*has an arduino* *calculates everything with logic gates*
@kalebbruwer
@kalebbruwer 5 лет назад
Absolute madlad
@God-ch8lq
@God-ch8lq 4 года назад
1. he's a madlad 2. it frees the arduino to do more important calculations, an arduino is sngle threaded, it cannot do both at once
@skyc3560
@skyc3560 4 года назад
God I mean yes, but with what simple math this is, it would take maybe 200-300 clock cycles.
@playaspec
@playaspec 4 года назад
Real men add hardware acceleration built from logic gates to their microcontrollers.
@electronichaircut8801
@electronichaircut8801 3 года назад
@@God-ch8lq The arduino has hardware modules for data checking.
@gnpar
@gnpar 3 года назад
The explanations are so good that sometimes we don't even realize that the video editing is also superb
@LawrencceF
@LawrencceF 5 лет назад
Your notification is something rare that makes me happy everytime I see it. Keep uploading this content man, your videos are amazing!
@shinigamilee5915
@shinigamilee5915 5 лет назад
Agreed. This kind of video takes a lotof time. It's nice to see.
@oscill8ocelot
@oscill8ocelot 5 лет назад
I stopped watching a different video when I saw the notification pop up. :3
@oscill8ocelot
@oscill8ocelot 5 лет назад
♫ Just keep sliding, just keep sliding! ♫
@alphadek
@alphadek 5 лет назад
Incredible work :) you really explain things perfectly well
@giacomo.delazzari
@giacomo.delazzari 5 лет назад
So amazing to see an algorithm I always use implemented in hardware! As a suggestion, you can hook up the FFs clear pins to the Arduino reset pin, that way when you press the reset button the pin will go to GND (that's what the button does on the PCB). You also benefit from the free pull-up that's on the Arduino board :)
@BenEater
@BenEater 5 лет назад
Cool idea!
@k98killer
@k98killer 5 лет назад
This is inspiring me to build a CRC-16 generator in Minecraft this weekend. This is going to take a while. Edit: a shift register with some XOR gates isn't too difficult and took only like half an hour to lay out and test. Making a wireless communication system that generates a CRC-16, however, would take all weekend.
@prathamkalgutkar7538
@prathamkalgutkar7538 Год назад
It's been 3 Years now but We would like to know and/or see what's the status to your peoject? :)
@k98killer
@k98killer Год назад
@@prathamkalgutkar7538 I forgot about it after making and testing a bunch of component circuits. Ran into conceptual issues with laying out and connecting all of the parts iirc.
@jdatdeface
@jdatdeface 5 лет назад
It is a bad idea to use Arduino Pin13 for input, because while bootloader is working Pin13 is OUTPUT and this conflict with XOR output. 1K series resistor after XOR is OK, but better avoid connect Pin13 to any push-pull outputs.
@ryanmustain6545
@ryanmustain6545 2 года назад
I work in an industry where I need to understand CRC, FEC, parity, etc. This is by far the coolest, most thoroughly and concise explanation of this material I have ever seen. It makes me want to grab a breadboard and start exploring this side of the coin. Thanks!
@millertime08
@millertime08 Год назад
I really loved this series. Once I started, I was on the edge of my seat waiting to see how error detection would get better and better. Really amazing seeing the idea on paper and then transformed into an elegant circuit. Thanks so much for making these videos and explaining every step in such detail!
@weirdboyjim
@weirdboyjim 5 лет назад
Always impressed with your skill at explaining things. That simple trick of covering half the XOR truth table was vastly better than my last attempt at explaining it.
@willyarma_uk
@willyarma_uk 5 лет назад
Absolutely brilliant, its something that's confused me for a long time, made very simple! Have you any interest in doing forward error correction?
@tategeiger5317
@tategeiger5317 5 лет назад
Woohoo! A ben video! I saw the bell and knew my homework was going to have to wait ;)
@timsmith2525
@timsmith2525 5 лет назад
You are a good teacher. You do a great job of breaking the problem down into logical steps that are easy to understand.
@tozpeak
@tozpeak 2 года назад
I learned field algebra laws in my university on Software Engeneering cource. I might even see a XOR algebra as an example, but matrix algebra took more attention. This is the first time I see XOR algebra is applied to a real world problem. And this is such a pleasure to watch how theory you knew is getting common sense to exist. Your course about 8-bit PC was inspiring and helped me to fill the gap between adder (summer) from school and assembly from university. Now you remembered me how much I loved math while it was appliable, and I hope inspire to learn some high math again. Beautiful channel, thank you for your work!
@ulyssedurand6810
@ulyssedurand6810 5 лет назад
Can't understand how you do to make people understand electronics that easily, myself I am not particulary focused on the video and still I understand everything you explain. Thanks, keep going (Hello from France by the way)
@Skiddla
@Skiddla 4 года назад
Hella from France 0b0101001001111000
@gaharmun
@gaharmun 5 лет назад
Excellent Video as always... But the read of the crc result into the Arduino feels a bit “meh” to me... You actually don’t need to read the crc output into the Arduino. Instead use an AND gate and crc output and crc read as inputs and then OR the result with tx data. And since you are not transmitting anything, when generating the crc, you could pulse the clock for the 16 zeros much quicker (as fast as the chips can handle, probably MHz...)
@squelchedotter
@squelchedotter 5 лет назад
Even when reading it with the arduino, you could have just ANDed the CRC input to turn the input into zeros instead of having two clocks.
@roberteliassen5020
@roberteliassen5020 5 лет назад
If I remember correct (I might be wrong), you don't have to shift in the 16 zeros at the end making a total of 40 shifts. You could get away with only 24 shifts if you modify the CRC circuit. Don't ask how. :-) I do indeed prefer Bens way as it explains the math perfect.
@Lorden1516
@Lorden1516 3 года назад
Thank you for your explanation of the columns in CRCCalc! I thought it was a bit off-topic for the video at first, but now I've successfully matched my CRC calculator to that website, now that I understand those columns. It's unfortunate that CRCCalc no longer shares their source code.. Also, I'm surprised that your hardware implementation didn't involve a table..! It's that same simple, infinite-length polynomial division.
@sidahmedbentrad8362
@sidahmedbentrad8362 5 лет назад
I love your notification 🔔 😍😍
@chrisocon
@chrisocon 5 лет назад
I pressed the bell icon because of this comment lol
@ftcgaming4651
@ftcgaming4651 5 лет назад
Gotta flip those bits
@Rx7man
@Rx7man 4 года назад
5:05 "This X^35 got flipped off" Yeah, I've done that many times while doing algebra as well
@9069able
@9069able 5 лет назад
I don't get this black magic.... Edit: I kinda get it now.....
@linuspauly2380
@linuspauly2380 5 лет назад
Pretty sure you could have gotten away without the diode toward the Arduino in your makeshift and, you could've set the Arduino pin away from output so it doesn't interfere.
@mikefochtman7164
@mikefochtman7164 4 года назад
I never really understood CRC until I watched your video. I can understand how early days you would calculate CRC in hardware and then send it along after the message. But after watching you having to add so many read/write pins for clocking CRC hardware separately, then reading CRC using a read-enable pin, I'm thankful I always got to do the CRC calculations in software (didn't understand them, just 'cookbooked' it) :)
@gottesman007
@gottesman007 5 лет назад
200 years later... Finally! I love your videos, so clear, interesting and actually funny to see
@davidprock904
@davidprock904 4 года назад
Stop flipping things off... sorry,, had to make a joke. Couldn't a particular logic gate setup, just one design, do the check and also create it
@noahchristman2077
@noahchristman2077 4 года назад
Now we just need a video for how the receiving computer can fix that error. Great video!
@glenngoodale1709
@glenngoodale1709 5 лет назад
I really enjoyed this video, and you gave some really great tips too! Thank you for your hard work, and keep up the great videos.
@marc_frank
@marc_frank 2 года назад
you could have also used some transistors to only send clk to the shift registers and only connect the crc output to the tx line that way there would be no gap in the transmission, although the transistors might distort the signal a bit
@squelchedotter
@squelchedotter 5 лет назад
Wouldn't it have been easier to AND the data input for the CRC unit with a pin? Instead of having two clocks. You'd then set the pin to 1 when you want to input your data to the CRC unit and 0 when not
@superdau
@superdau 5 лет назад
That doesn't do anything. What's the point of having having an additional gate to toggle a data value when you already have full control of that data value with your micro already? Not only that. You would also clock the receiver as well and send the zeros to it.
@RetroRogersLab
@RetroRogersLab 5 лет назад
Would you explain your selection of HC family? I've got LS and HCT families but haven't considered HC family.
@TomStorey96
@TomStorey96 5 лет назад
HC is CMOS, LS is TTL. CMOS is a more modern technology, and what a significant portion of logic is implemented as these days. Many LS parts may be hard or impossible to obtain, since CMOS has largely replaced TTL. HCT is simply HC with "TTL compatible" inputs. HC parts would typically need, say, 4.5+ volts to signify a logic high, but TTL can output much lower voltages for a logic high. Functionally, a HC, HCT or LS part of a given number would do the same thing. HCT can be used to interface modern 5V CMOS based circuits with older TTL circuits/devices, and is also useful for interfacing 5V circuits with 3.3V circuits - but only in the 3V3 -> 5V direction, unless your 3V3 parts have 5V tolerant pins! Downsides to using HCT are noise immunity, since it requires only roughly half the voltage of HC to represent a logic high.
@uwezimmermann5427
@uwezimmermann5427 5 лет назад
for low-speed, 5V breadboard constructions you can often mix 74xx, 74LSxx, 74HCxx and 74HCTxxx freely. The main differences are drive-capability, input voltage levels and speed.
@RetroRogersLab
@RetroRogersLab 5 лет назад
@@TomStorey96 Hi Tom. Thanks for the excellent reply. I'm familiar with the basic of each family. More curious if it was "what was on hand" or if there was a significant technical reason. I have a lot of LS parts in my supply so that is what I use. When I need to make a purchase, I price check LS vs HCT but am wondering if I should be considering HC for a new project. Off topic but is one family more readily available in surface mount packages? I tend towards hand wired boards thus my preference for through-hole packages but I'm interested in ordering PCBs for the first time and getting SMD experience.
@uwezimmermann5427
@uwezimmermann5427 5 лет назад
Ben's diode-based AND gate has a chance of not working correctly with 74LSxxx or 74HCTxxx logic, because the threshold of a correct zero on an input is about one diode drop or 0.6 V. This means that a logic LOW which is one diode drop above ground is at the border. Using Schottky diodes with a much lower voltage drop would make the circuit safe even for true TTL-level inputs.
@TomStorey96
@TomStorey96 5 лет назад
@@RetroRogersLab I think you will find LS surface mount parts hard to come by. HC and HCT will be much easier to find. I could be wrong, but I would say LS is deprecated, and anything you buy will probably be "new old stock", and possibly why HCT exists in the first place. HC(T) are in current production in various package types (and worth noting are the "little logic" family of devices, for that time when you only needed a single gate.)
@anno_nym
@anno_nym Год назад
This video was the first one, that gave me a deep understanding of how CRC's work and how to compute them. I really appreciate that you put this amount of effort into explaining everything and building all up from scratch.
@vg5028
@vg5028 3 года назад
With regards to the conclusion of this video (which points out the similarity of CRCs with parity checks) -- Why is it called "Cyclic Redundancy" check instead of n-bit parity, or something similar? What is the "cyclic" thing? And what is "redundant" here?
@renakunisaki
@renakunisaki 3 года назад
I assume the cyclic part is the shift register, and the redundancy part is sending two extra bytes to detect errors, which don't carry new information.
@ropersonline
@ropersonline 3 года назад
33:19: Wait, did you just build an AND gate from scratch? Could you also build all the other fundamental logic gates from only passive components? Would it not belie the active/passive component distinction if you can press diodes into transistor service?
@renakunisaki
@renakunisaki 3 года назад
You can, and that's how you did it before ICs. (But usually instead you came up with some electromechanical solution...)
@dnwheeler
@dnwheeler 5 лет назад
Could you simplify things a bit by clocking the CRC directly out of the CRC generator to the data line to the receiver? You'd still need the /READ signal and you'd have to be able to switch the data line from the Arduino to the CRC output, but that would eliminate the need for the Arduino to read CRC bits (and it would eliminate the "pause" that happens during that time).
@squelchedotter
@squelchedotter 5 лет назад
Yes, all that would be required would be an AND gate on the output.
@tonybell1597
@tonybell1597 5 лет назад
Excellent work Ben, really wish these vids were available when I was learning computing.... keep up the great work...
@donwald3436
@donwald3436 5 лет назад
Next video, receiver ack/nak?
@bryceforsyth8521
@bryceforsyth8521 5 лет назад
could you do something on ECC, perhaps?
@shamanthbv
@shamanthbv 5 лет назад
man your circuit wiring is so neat. i remember when i was using bread board none of my circuits were this neatly wired all of them were so jumbled that retracing my circuit was a nightmare for me. Whatever might be the case please keep up the good work.
@andyonions7864
@andyonions7864 Год назад
Absolutely brilliant. As a Comp Sci graduate I have to say your stuff is like a blast from the (very distant in my case) past. The only thing I'd add about CRCs is that fundamentally although they confer a good degree of confidence in the correctness of a message, they still allow for a 1 in 65536 chance of passing of a mangled message . For a high message noisy environment, this could (and certainly can be) problematic.
@kaitlyn__L
@kaitlyn__L Год назад
Yep. When I had a noisy DSL line the CRC error count was through the roof, on the order of 10,000s every few minutes. They were caught and retransmitted, but on top of that about 1% of my TCP packets would still fail their own checks and request a retransmit on the protocol layer. So about 1% of errors were making it through the modem’s own CRC checks!
@andyonions7864
@andyonions7864 Год назад
@@kaitlyn__L commercially I'm working on a wireless system. I get duff messages every 10 mins even though their crcs are good.
@kaitlyn__L
@kaitlyn__L Год назад
@@andyonions7864 that’s rough. I knew RF was noisier than even a maximum-length DSL run, but oof.
@vylbird8014
@vylbird8014 5 лет назад
It's so easy when you have a clock signal too. Clock recovery is half the fun.
@danielclark5385
@danielclark5385 4 года назад
Amazing error detection series, came here from your 8-bit breadboard computer videos and will continue with that now too!
@RichardVodden1
@RichardVodden1 4 года назад
This is an amazing set of videos. I wonder if you'd do a follow up introducing the elimination of the clock line. Perhaps using Manchester coding and cover the timing issues with the xor on the generation side and a suitable clock recovery technique?
@IronLotus15
@IronLotus15 4 года назад
It's not part of this series, but he does cover Manchester encoding in an earlier networking series of his.
@00zuu00
@00zuu00 5 лет назад
Nice video, I really liked the bit fliping circuit, very clever! I have one doubt though. When I saw the chained D-flipflops, it was not clear to me why the entering signal was not propagating direcly through all of them on each clock pulse. I watched the D-latch video, and in fact I saw that when the enable is active the output follows the input, at this point I understand that if you chained several D-latches they all would've been set to the same state. Then I checked the D-flipflop video where the edge detectors are introduced, however I was still thinking that this propagation issue could happen. The explanation I'm thinking of is that there's a propagation delay so that the D-flipflop can be "storing" a new input while the output is still the old one, and that the clock pulse is shorter than that delay thus disabling the D-flipflop just before the signal propagates through. Am I somewhere close to the correct answer? I'd like to better understand the behavior of the circuit, thank you!
@johnmoe6055
@johnmoe6055 5 лет назад
Up next Reed-Solomon on a breadboard?
@playaspec
@playaspec 4 года назад
I would find Manchester decoding to be more useful. Thematically you're right, but wireless is hot right now, and right now his system is carrying clock and data seperately.
@LiEnby
@LiEnby 5 лет назад
Holy fuck seeing that really complicated division problem turn into just repeated Shift 1 flip 3 over and over again is super crazy Also just a bunch of flip flops? CRC in Minecraft wen eta?
@cheeseparis1
@cheeseparis1 5 лет назад
Thank you! these CRC videos are amazing! Is there a way to find which bits are faulty according to the not-null CRC you receive? Then you would be able to change the "receive" side program to remove the last two bytes and display "transmission error on chars #x and #y" if the CRC is not null
Далее
Reliable data transmission
43:54
Просмотров 1,6 млн
How do CRCs work?
47:30
Просмотров 630 тыс.
11 ming dollarlik uzum
00:43
Просмотров 681 тыс.
ДЕНЬ УЧИТЕЛЯ В ШКОЛЕ
01:00
Просмотров 1,2 млн
Трудности СГОРЕВШЕЙ BMW M4!
49:41
Просмотров 1,5 млн
What is error correction? Hamming codes in hardware
36:46
Keyboard interface hardware
28:27
Просмотров 325 тыс.
Changes coming for 2024
24:08
Просмотров 374 тыс.
How 3 Phase Power works: why 3 phases?
14:41
Просмотров 1,2 млн
Hardware interrupts
27:36
Просмотров 596 тыс.
You've Never Seen A Vise Like This! - Restoration
24:45
Error detection: Parity checking
21:42
Просмотров 359 тыс.
Build an Arduino EEPROM programmer
57:30
Просмотров 1,5 млн