@@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...
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.
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.
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!
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
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.
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!
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.
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!
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!
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 …
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.
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! :)
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) :)
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.
WOW!! I used 3 breadboards for the TX/RX setup... LED's lined the middle board... I had room for an 74ls08 "AND" chip... it works as advertised, inputs were the READ signal from the Nano, and the last bit from the FF's... the output got fed back into the XOR's........ and it was a flawless CRC.... I put a Picture on my setup on my youtube if anyone is interested in seeing what I built... Thanks Ben, this was a Fantastic Teaching tool...
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.
Oh my god. What a journey. You state a problem, then go into a wild ride of analysis and by way of complex series of deductions, you arrive at a solution. You implement it, test it, and then when EVERYTHING WORKS (most of the time), while others would be going like "AS YOU CAN SEE, I DO THE VOODOO MAGIC", you're like "oh hey it worked, cool. Moving on...". You truly have a gift. I wish I was in a position I could repay you somehow, but at least know that your videos are changing my world. Thank you so much!
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 :)
I wouldn't have dropped out of EE if my professors took this approach. 20 years later all of this is actually making sense. Kudos for well-thought-out-ness and clarity!
Hello Ben, I have been researching MANY different ways to calculate the CRC and when I saw yours I was blown away! I do NOT have bread boards, but I have A LOT of interest to reproduce the shift register results you had. I am not using the same protocol however; my application runs CRC-16 MODBUS. I surmised concluded the following steps: 'PLEASE CORRECT ME IF I HAVE IT WRONG." 1. Assemble all bits into string of binary including CRC initial. "My case all '1's." 2. Reflect IN, 'TRUE', flip all bits of my initial message. "exclude the crc" 3. Shift to left most is equal to '1' 4. Left Most = '1', xor polynomial bits 16-1 5. Xor complete, repeat steps 3 & 4. 6. Continue loop until polynom of 16 is at LMB = 1 @ bit 16 or until it can-not fit "so if there is a '1' at bit 14 but the polynom is 16 long, remainder is calculate polynom 7. After calculation, Reflect output of calutation "TRUE" in my case so I flip the bits in my output. 8. After I flip the bits I check the xor output requirement which is "0x0000" so i surmise that means do not xor output? Then I compare to target value fro ma known calculator source. My shift register does NOT produce the target value. Please let me know if there is a flaw in my process.
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.
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!
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.
It makes a big difference absorbing the information seeing you do this physically. Just on paper or whiteboard doesn't have near the same impact. I know it makes showing the principle a lot longer but it really sticks better. Thanks Ben!
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)
If only I had had access to these videos during my college years, life would have been so much easier. My instructor was very good, but these are so much clearer. Thanks for the effort.
Brilliant! That XMODEM rings a bell. I reckon I saw it on terminal window when the old 4800bps dial-up modem connected to service provider with that remarkable buzzing sound!
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.
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!
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.
This is the most beautiful video I’ve ever seen. I was struggling to visualize and translate the math from the CRC calculation into digital blocks and then into SystemVerilog, but you explained so perfectly. Thanks a lot!!
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 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.
This was wonderful. I recently watched the whole breadboard computer build series to get here, after accidentally finding your recent Video Card episode . I was in the lucky 80s Kids-at-British-Schooling bracket of Computer Studies, learning twos compliment and machine level logic of binary maths at school when 13. Did a talk for high school English grades on how the insides of a Sinclair Spectrum [TIMEX 2048 in USA] worked. But I've never seen such a well taught full beginning to end foundation in "how it works - the computer". Your recent ones on error checking have covered things I've never thought of thinking about until now, and the sheer logic of it all is inspiring. I shall share this channel with every nerd I meet :)
Thank you Ben, for making all of these amazing videos. I've been in IT for almost 20 years, and I've always wanted to know exactly how does a computer work. All of these videos have given me such a greater understanding of all of this technology. You're awesome. You rock. Keep making awesome videos!!!!
Over the years I have found quite a few excellent channels. It's only when I see a notification from your channel that I ABSOLUTELY know I'm in for a wonderful ride
Absolutely brilliant description of the maths behind polynomial division made it seem so simple. Then to see how it is implemented in hardware so simply almost seems like magic when it actually works! One thing I noticed in your Arduino code is that you put the echo of the transmit clock AFTER the shift-register clock. Strictly speaking I guess this could cause a race condition where your shift register output starts changing BEFORE you have latched the transmitted data. It is probably never likely to cause a problem unless you were single-stepping through the code but I would have set the transmit clock BEFORE the shift register clock.
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
Though my use case project for the CRC series has evolved beyond needing a robust communication protocol between a raspberry pi 3 and two arduino's over a bit banged I2C bus, perhaps it could still be implemented in the latest revision, in software of course. Thanks for explaining CRC with hardware and blinky lights! Seems to be the way to learn new things.
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.
I have to saw this is the best explanation ever Ben! I've been struggling understanding the how the shifting registers and XOR Gates interact with one another. I plan to building this experiment
Thanks for this great series. The maths were explained so well and so clearly that I understood straight away. I wish all uni teachers had similar skills!
Your videos never fail to impress. Hopefully one of these days when I have the cash flow, I'm planning on purchases your full 8-bit CPU kit. I'd love to try my hand at building it!
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.
What an awesome video! I can see that it must have taken many many hours to make. Just the wire management on a bread-board alone would have been tedious work. Learned a lot from this. Keep up the incredible work.
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
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++!
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.
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!
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.
That was artfully delivered. I have dabbled, ever so slightly in circuit design and Arduino programming and I have never worked with logic circuits though I am familiar with what they are and what they do. I was able to follow your explanation and came away with a new understanding of how voltage drops affect circuit function and how clock signals are used. Thank you.
I also like the error-correction possibilities of the two-dimensional parity bit solution.. Though I usually try to make it more square by not doing the horizontal lines just the one byte wide.. Also two way communication is fairly important.. If the receiver detects an error doesn't mean the sender know it has to send again.. so I would kind of make use of BOTH methods.. but I use the crc of the corrected bitstream as the response when all as hbeen transmitted and negotiate a re-transmission if it doesn't fit.. that way the error-correction solutions implemented will not only guess whether it's right, but also be able to make a simple question as to "is this right?", so it only gets re-transmitted if the error-correction failed.
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?
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.
I was wanting something to go to sleep to. I thought this (and the precursors to this video) would be interesting but dry enough to put me to sleep. Well, now its 2:10am and I'm frantically searching all my boxes for a second shift register.
Watching that complex math boil down to such simple logic operations was the most beautiful thing I ever saw
it's really all math, understanding it what makes it beautiful
Have you seen the punchline at the end though? (51:44) ;)
you should look into 3blue1brown channel
I feel so sad that his channel is so underrated, but really crappy videos is really popular, bit disappointed in humanity
@@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...
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.
Amen! (I'm in the same 'boat' ;-)
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.
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!
The explanations are so good that sometimes we don't even realize that the video editing is also superb
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
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!
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.
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!
Nice improvement!
Thanks alot can you be kind enough to share this on github
Well, unless the CRC is calculated as you transmit like in this case and then your CRC is ready when the message is complete
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.
Why init with zeros then shift in a zero?
Just wanted to say that I'm glad you're making videos again! Love all of them!
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!
20:18 This reveal was amazing, seeing the circuit and suddenly realising how elegantly it implements the algorithm. Nicely edited!
Well as far as i am informed the circuit was kinda there before people started doing it in software
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!
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 …
Well noted sir
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.
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! :)
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) :)
"Hella, world!" ... could not have planned that
This whole series was just an elaborate setup ;)
It actually happened in a previous video too
@@abcrtzyn IMO should have been Hella, word!
2019: "Hello, world!"
2020: "Hella world!"
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.
WOW!! I used 3 breadboards for the TX/RX setup... LED's lined the middle board... I had room for an 74ls08 "AND" chip... it works as advertised, inputs were the READ signal from the Nano, and the last bit from the FF's... the output got fed back into the XOR's........ and it was a flawless CRC.... I put a Picture on my setup on my youtube if anyone is interested in seeing what I built... Thanks Ben, this was a Fantastic Teaching tool...
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.
Oh my god. What a journey.
You state a problem, then go into a wild ride of analysis and by way of complex series of deductions, you arrive at a solution. You implement it, test it, and then when EVERYTHING WORKS (most of the time), while others would be going like "AS YOU CAN SEE, I DO THE VOODOO MAGIC", you're like "oh hey it worked, cool. Moving on...".
You truly have a gift. I wish I was in a position I could repay you somehow, but at least know that your videos are changing my world. Thank you so much!
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 :)
Cool idea!
I wouldn't have dropped out of EE if my professors took this approach. 20 years later all of this is actually making sense. Kudos for well-thought-out-ness and clarity!
Hello Ben,
I have been researching MANY different ways to calculate the CRC and when I saw yours I was blown away!
I do NOT have bread boards, but I have A LOT of interest to reproduce the shift register results you had.
I am not using the same protocol however; my application runs CRC-16 MODBUS.
I surmised concluded the following steps: 'PLEASE CORRECT ME IF I HAVE IT WRONG."
1. Assemble all bits into string of binary including CRC initial. "My case all '1's."
2. Reflect IN, 'TRUE', flip all bits of my initial message. "exclude the crc"
3. Shift to left most is equal to '1'
4. Left Most = '1', xor polynomial bits 16-1
5. Xor complete, repeat steps 3 & 4.
6. Continue loop until polynom of 16 is at LMB = 1 @ bit 16 or until it can-not fit "so if there is a '1' at bit 14 but the polynom is 16 long, remainder is calculate polynom
7. After calculation, Reflect output of calutation "TRUE" in my case so I flip the bits in my output.
8. After I flip the bits I check the xor output requirement which is "0x0000" so i surmise that means do not xor output?
Then I compare to target value fro ma known calculator source.
My shift register does NOT produce the target value.
Please let me know if there is a flaw in my process.
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.
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!
@@kaitlyn__L commercially I'm working on a wireless system. I get duff messages every 10 mins even though their crcs are good.
@@andyonions7864 that’s rough. I knew RF was noisier than even a maximum-length DSL run, but oof.
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.
It makes a big difference absorbing the information seeing you do this physically. Just on paper or whiteboard doesn't have near the same impact. I know it makes showing the principle a lot longer but it really sticks better. Thanks Ben!
You are a good teacher. You do a great job of breaking the problem down into logical steps that are easy to understand.
Your notification is something rare that makes me happy everytime I see it. Keep uploading this content man, your videos are amazing!
Agreed. This kind of video takes a lotof time. It's nice to see.
3 years later and still absolutely the best video for a beginner to learn this topic.
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)
Hella from France 0b0101001001111000
This guy is awesome. How he divides all complicated systems to their simplest logic is marvellous
If only I had had access to these videos during my college years, life would have been so much easier. My instructor was very good, but these are so much clearer.
Thanks for the effort.
Brilliant!
That XMODEM rings a bell. I reckon I saw it on terminal window when the old 4800bps dial-up modem connected to service provider with that remarkable buzzing sound!
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.
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!
Now we just need a video for how the receiving computer can fix that error. Great video!
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.
This is the most beautiful video I’ve ever seen. I was struggling to visualize and translate the math from the CRC calculation into digital blocks and then into SystemVerilog, but you explained so perfectly. Thanks a lot!!
200 years later... Finally!
I love your videos, so clear, interesting and actually funny to see
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.
It's been 3 Years now but We would like to know and/or see what's the status to your peoject? :)
@@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.
This was wonderful. I recently watched the whole breadboard computer build series to get here, after accidentally finding your recent Video Card episode . I was in the lucky 80s Kids-at-British-Schooling bracket of Computer Studies, learning twos compliment and machine level logic of binary maths at school when 13. Did a talk for high school English grades on how the insides of a Sinclair Spectrum [TIMEX 2048 in USA] worked. But I've never seen such a well taught full beginning to end foundation in "how it works - the computer". Your recent ones on error checking have covered things I've never thought of thinking about until now, and the sheer logic of it all is inspiring.
I shall share this channel with every nerd I meet :)
Don't know if anyone ever told you this, but with your videos you're carrying so many EE/CS students, you really make the world a better place.
Amazing error detection series, came here from your 8-bit breadboard computer videos and will continue with that now too!
Thank you Ben, for making all of these amazing videos. I've been in IT for almost 20 years, and I've always wanted to know exactly how does a computer work. All of these videos have given me such a greater understanding of all of this technology. You're awesome. You rock. Keep making awesome videos!!!!
I can't stop watching your series on this subject. Fantastic. All of this takes me way back, and it is a nice refresher. Thanks for these videos.
OMG. I am flashing back to my Radio Engineering Days !!! I worked with both Analog and the FIRST Digital Transmitters.
Over the years I have found quite a few excellent channels. It's only when I see a notification from your channel that I ABSOLUTELY know I'm in for a wonderful ride
Nice to see you doing-it-the hard-way, along with your clarity of thought, and explanation. Well done.
Can't even imagine how long it takes you to bend those wires around to make a neat presentation! Hat's off to you Ben Eater!
Absolutely brilliant description of the maths behind polynomial division made it seem so simple. Then to see how it is implemented in hardware so simply almost seems like magic when it actually works! One thing I noticed in your Arduino code is that you put the echo of the transmit clock AFTER the shift-register clock. Strictly speaking I guess this could cause a race condition where your shift register output starts changing BEFORE you have latched the transmitted data. It is probably never likely to cause a problem unless you were single-stepping through the code but I would have set the transmit clock BEFORE the shift register clock.
Man, it's a real joy to see you uploading again... Thank you Ben!
Brilliant! Watched all your video series on the topic within the span of a couple of days and everything is so beautifully linked! Nice work!
Always a delight when you upload!
I needed to get a grasp of CRC asap for my thesis with DNP and this did it! Thank you !
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
Perhaps YT needs a "42" classification... If "42" isn't a familiar concept, ask the internet. :-)
It's so satisfying watching the last credit/patreon message CRC check to a 0 understanding what is happening!
Can't say too much about how I love your content with the degree of clarity and depth that you put into it. Thank you!
Though my use case project for the CRC series has evolved beyond needing a robust communication protocol between a raspberry pi 3 and two arduino's over a bit banged I2C bus, perhaps it could still be implemented in the latest revision, in software of course. Thanks for explaining CRC with hardware and blinky lights! Seems to be the way to learn new things.
I did all these in theory! It would’ve been so great to actually see it in motion. My gosh!
Incredible work :) you really explain things perfectly well
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.
I stopped watching a different video when I saw the notification pop up. :3
♫ Just keep sliding, just keep sliding! ♫
I have to saw this is the best explanation ever Ben! I've been struggling understanding the how the shifting registers and XOR Gates interact with one another. I plan to building this experiment
Excellent work Ben, really wish these vids were available when I was learning computing.... keep up the great work...
Thanks for this great series. The maths were explained so well and so clearly that I understood straight away. I wish all uni teachers had similar skills!
Your videos never fail to impress. Hopefully one of these days when I have the cash flow, I'm planning on purchases your full 8-bit CPU kit. I'd love to try my hand at building it!
Your explanations are so clear & effective. You are a great teacher / communicator!
I have been working on ethernet for 8 years. And written crc computation functions.. but this is truly amazing.
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.
This is the best UA-cam channel I’ve ever seen.
Very clearly explained, I like your use of paper cutouts and appreciate your effort to make them.
What a brilliant video. I can't imagine how much effort that took to make. Bravo, really interesting and engaging.
What an awesome video! I can see that it must have taken many many hours to make. Just the wire management on a bread-board alone would have been tedious work. Learned a lot from this. Keep up the incredible work.
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
Thank you for making complex concepts available to everyone. Just brilliant!
Excellent explanation/implementation, so simple and effective. Congratulations Ben.
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++!
I finally found a scenario I can use the word. Mesmerized. I have been mesmerized today
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.
Your videos are always so insightful and beautifully paced and detailed. Genuinely thank you.
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!
Damn, your videos on data transmission and error checking have been awesome!
OMG, YT just suggested this video and I saw all the great content you have. Looks like I will be very busy this weekend.
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.
That was artfully delivered. I have dabbled, ever so slightly in circuit design and Arduino programming and I have never worked with logic circuits though I am familiar with what they are and what they do. I was able to follow your explanation and came away with a new understanding of how voltage drops affect circuit function and how clock signals are used. Thank you.
What an incredible teaching talent you have!
Superb video as always, crystal clear explanation. Thanks Ben.
Best explanation of howto CRC i've seen!!!
I also like the error-correction possibilities of the two-dimensional parity bit solution.. Though I usually try to make it more square by not doing the horizontal lines just the one byte wide.. Also two way communication is fairly important.. If the receiver detects an error doesn't mean the sender know it has to send again.. so I would kind of make use of BOTH methods.. but I use the crc of the corrected bitstream as the response when all as hbeen transmitted and negotiate a re-transmission if it doesn't fit.. that way the error-correction solutions implemented will not only guess whether it's right, but also be able to make a simple question as to "is this right?", so it only gets re-transmitted if the error-correction failed.
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?
It's not part of this series, but he does cover Manchester encoding in an earlier networking series of his.
This educational content is just out of this world !
5:05 "This X^35 got flipped off"
Yeah, I've done that many times while doing algebra as well
Thanks for simplifying the subject so much could never understand CRC concept back in my clg days now I get it all.
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.
Good to see you back Ben.
That's cool! I've done OR gates with diode logic but never known how and AND wold be done.... thanks for that.
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.
This is a great presentation on CRCs.
Thanks Ben, your videos are always nice to watch and from a hi quality.
Woohoo! A ben video! I saw the bell and knew my homework was going to have to wait ;)
I was wanting something to go to sleep to. I thought this (and the precursors to this video) would be interesting but dry enough to put me to sleep. Well, now its 2:10am and I'm frantically searching all my boxes for a second shift register.