<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>computer science basics Archives - NeuralLantern.com</title>
	<atom:link href="https://www.NeuralLantern.com/tag/computer-science-basics/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.NeuralLantern.com/tag/computer-science-basics/</link>
	<description></description>
	<lastBuildDate>Sun, 20 Jul 2025 09:16:00 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://www.NeuralLantern.com/wp-content/uploads/2025/04/cropped-2025-04-04-Lantern-03-32x32.png</url>
	<title>computer science basics Archives - NeuralLantern.com</title>
	<link>https://www.NeuralLantern.com/tag/computer-science-basics/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Master Stacks: Fun Guide to Data Structures, LIFO &#038; Real-World Uses</title>
		<link>https://www.NeuralLantern.com/master-stacks-fun-guide-to-data-structures-lifo-real-world-uses/</link>
					<comments>https://www.NeuralLantern.com/master-stacks-fun-guide-to-data-structures-lifo-real-world-uses/#respond</comments>
		
		<dc:creator><![CDATA[mike]]></dc:creator>
		<pubDate>Sun, 20 Jul 2025 09:15:59 +0000</pubDate>
				<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[Videos]]></category>
		<category><![CDATA[browser history stack]]></category>
		<category><![CDATA[call stack]]></category>
		<category><![CDATA[coding for beginners]]></category>
		<category><![CDATA[computer science basics]]></category>
		<category><![CDATA[data reversing]]></category>
		<category><![CDATA[data structure basics]]></category>
		<category><![CDATA[data structures tutorial]]></category>
		<category><![CDATA[learn coding]]></category>
		<category><![CDATA[LIFO data structure]]></category>
		<category><![CDATA[programming tutorials]]></category>
		<category><![CDATA[push pop stack]]></category>
		<category><![CDATA[stack data structure]]></category>
		<category><![CDATA[stack in C++]]></category>
		<category><![CDATA[stack operations]]></category>
		<category><![CDATA[stack programming]]></category>
		<guid isPermaLink="false">https://www.NeuralLantern.com/?p=186</guid>

					<description><![CDATA[<p>Learn stacks: fun guide to data structures, LIFO, &#038; uses like browser history. Clear diagrams for beginners!</p>
<p>The post <a href="https://www.NeuralLantern.com/master-stacks-fun-guide-to-data-structures-lifo-real-world-uses/">Master Stacks: Fun Guide to Data Structures, LIFO &amp; Real-World Uses</a> appeared first on <a href="https://www.NeuralLantern.com">NeuralLantern.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<iframe title="Master Stacks: Fun Guide to Data Structures, LIFO &amp; Real-World Uses" width="1380" height="776" src="https://www.youtube.com/embed/mAqB77KUUKY?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
</div></figure>



<p>Want to nail down stacks? This beginner-friendly video breaks down the stack data structure with clear diagrams and a laid-back vibe. We’ll walk you through how stacks work, why they reverse data (hello, LIFO &#8211; Last In, First Out), and how they’re used in real-world stuff like browser history, undo features in editors, and even the call stack in your code. Whether you’re just starting out or brushing up on data structures, we keep it simple with hands-on demos of pushing, popping, and checking stack size—no boring jargon here! Subscribe for more coding tutorials to level up your skills, and let us know in the comments what you want to learn next. Check out our site via the QR code in the video for more coding goodness!</p>



<p>Introduction to Stack 00:00:00<br>Explaining Stack Concept 00:00:06<br>Drawing Stack Diagram 00:00:30<br>Adding Elements to Stack 00:00:53<br>Stack Rules and Operations 00:01:16<br>Pop Operation and Interface 00:06:09<br>Stack Size and Empty Check 00:07:59<br>Tracing Stack Operations 00:11:46<br>Stack as Data Reverser 00:17:44<br>LIFO/FILO Explanation 00:21:13<br>Stack Use Cases 00:24:10<br>Call Stack Mention 00:26:18<br>Conclusion and Subscribe Request 00:27:21<br>Outro and Website Promotion 00:28:34</p>



<p>Thanks for watching!</p>



<p>Find us on other social media here:</p>



<ul class="wp-block-list">
<li>https://www.NeuralLantern.com/social</li>
</ul>



<p>Please help support us!</p>



<ul class="wp-block-list">
<li>Subscribing + Sharing on Social Media</li>



<li>Leaving a comment or suggestion</li>



<li>Subscribing to our Blog</li>



<li>Watching the main &#8220;pinned&#8221; video of this channel for offers and extras</li>
</ul>



<p>Hello there.</p>



<p>In this video, I&#8217;m going to show you a data structure called a stack.</p>



<p>We&#8217;re going to make a diagram of it.</p>



<p>We&#8217;re going to explain how it works.</p>



<p>We&#8217;re going to look at its typical interface,</p>



<p>and we&#8217;re just going to kind of work through the concept</p>



<p>of what is a stack and what does it do and all that stuff.</p>



<p>Where&#8217;s your daddy and what does he do?</p>



<p>So for starters, what am I talking about?</p>



<p>What am I talking about?</p>



<p>Let me open up a little notepad here.</p>



<p>And I&#8217;m going to start drawing.</p>



<p>A stack is pretty simple when you first think about it.</p>



<p>It just takes a little bit more work to really get all the details down.</p>



<p>Imagine I have a data structure and maybe like at the bottom here,</p>



<p>there&#8217;s like some grass.</p>



<p>And so we can say that the data structure is empty when we first start.</p>



<p>Okay, so there&#8217;s kind of a stack here, but it&#8217;s empty.</p>



<p>So there&#8217;s nothing really on screen.</p>



<p>Imagine then I wanted to add integers into this stack.</p>



<p>So I&#8217;m going to say let&#8217;s add the integers eight and then two and then three and then four for some reason.</p>



<p>Okay, so how do we do this?</p>



<p>The first thing we do is we take the eight and we just put it on top of the stack.</p>



<p>You can imagine this as a stack of boxes or a stack of books or a stack of whatever.</p>



<p>When we add items, we&#8217;re always going to add to the top of the stack.</p>



<p>When the stack is empty, we&#8217;re obviously just going to add like at the very bottom, you know, at the ground floor.</p>



<p>But that&#8217;s sort of the top.</p>



<p>when we add the two here the next thing that happens is we just put the two on top of the eight</p>



<p>and the next thing that we do is we uh put the three on top of the two and so forth right so</p>



<p>it&#8217;s important to understand a few a few rules about stacks let me add that four real fast</p>



<p>in stacks you&#8217;re only allowed to add to the top or remove from the top you&#8217;re not allowed to add</p>



<p>or remove from anywhere else let me put a t for top right here so basically you&#8217;re allowed to add</p>



<p>So basically you&#8217;re allowed to add and remove from the top.</p>



<p>So if I wanted to add, let&#8217;s say a 12, the 12 would have to go on top of the four.</p>



<p>It couldn&#8217;t go anywhere else in this data structure.</p>



<p>And if I wanted to remove data from this stack, I could only remove the four.</p>



<p>I could not remove the three or two or the eight or anything.</p>



<p>You&#8217;re also not allowed to look at the middle of the stack.</p>



<p>You&#8217;re not allowed to look anywhere but the top.</p>



<p>So if I wanted to look at the three, the two or the eight, I wouldn&#8217;t be allowed to do it.</p>



<p>I can only look at the four.</p>



<p>look at the four and if I want to see that three I have to pop the four off</p>



<p>first in order to just see what&#8217;s under it and technically unless you have the</p>



<p>data you added memorized somewhere else you probably shouldn&#8217;t know what&#8217;s under</p>



<p>the four until you actually remove it okay so we can add and remove from the</p>



<p>top we can&#8217;t look in the middle we can&#8217;t look at the bottom or anything like that</p>



<p>and let&#8217;s do a little let&#8217;s do a little sequence of pops let me show you what</p>



<p>So first off, you can imagine a stack is sort of like a vector or a list with less functionality or more restrictions.</p>



<p>It&#8217;s useful to add restrictions on top of more robust data structures for the purposes of, I don&#8217;t know, kindling your imagination or allowing yourself to use easier implementations or whatever.</p>



<p>If you&#8217;re a musician or artist, probably at some point you&#8217;ve been stumped and you&#8217;ve had writer&#8217;s block and you can&#8217;t figure out what to create.</p>



<p>can&#8217;t figure out what to create so uh you know i know sometimes musicians when they get writer&#8217;s</p>



<p>block they&#8217;ll they&#8217;ll go to the swap meet and they&#8217;ll buy like an old dusty dirty uh casio</p>



<p>keyboard from 1985 and then they&#8217;ll write a full song just with that one piece of equipment and it</p>



<p>really stirs their creativity or it sparks their creativity and then when they&#8217;re done then they&#8217;ll</p>



<p>probably upgrade to better equipment but anyway so there&#8217;s there&#8217;s a bunch of different reasons to</p>



<p>use you know lesser data structures although this is not really lesser it&#8217;s very useful</p>



<p>It&#8217;s very useful in its own right.</p>



<p>So let&#8217;s see the interface.</p>



<p>So what can we do in a stack?</p>



<p>I&#8217;m going to put S for stack.</p>



<p>Actually, I&#8217;m just going to type this up as code.</p>



<p>No need to use the pen the whole entire time.</p>



<p>Let&#8217;s see.</p>



<p>So I&#8217;m going to put S for stack.</p>



<p>Maybe I&#8217;ll say, you know, stack that holds integers.</p>



<p>And I&#8217;ll just put an S here.</p>



<p>If you don&#8217;t know how to code right now, at this point in your career, just bear with</p>



<p>me.</p>



<p>variable of type stack and in C++ these stacks you know stacks are a template of data structure</p>



<p>which means the integers that we are holding inside of the stack they could be any other data</p>



<p>type that we wanted to including custom classes so in C++ we would use these angle brackets to</p>



<p>say I want my stack to hold integers and then I&#8217;m going to say s is the variable that I&#8217;ll use for</p>



<p>the stack so but this is not really a programming video this is just about stacks so if I wanted to</p>



<p>stack to push something like onto the top of the stack i would use the the method push the method</p>



<p>push usually has this prototype let&#8217;s see i&#8217;ll do stack push and it usually takes in a t type element</p>



<p>and again the t type it&#8217;s a templated data type which means right now if i just declared a stack</p>



<p>that was of type integer it holds integers then the t would actually expand under the hood in c</p>



<p>hood in C++ anyway at compile time to be an integer. So it would be like typing int e, right?</p>



<p>So whenever I type t, just understand that that means one instance of a thing that you could put</p>



<p>into the stack. So we&#8217;ve got a push here and usually the return type is void and it takes in</p>



<p>one element to push. And that means if I&#8217;m going to actually call, let me put some comments here.</p>



<p>If I&#8217;m going to actually call push on the stack, I&#8217;ve got to give it something to push and the</p>



<p>type of the thing that I&#8217;m pushing has to match what the stack was declared to hold. So in this</p>



<p>case, it&#8217;s integers. So I&#8217;m going to put an eight to match the diagram up above. And then after that,</p>



<p>maybe I wanted to push another number. So it&#8217;s going to be a two. And I&#8217;m just going to match</p>



<p>what the diagram has up above. So eight, two, three, four. So that&#8217;s the interface for pushing</p>



<p>usually in C++. And other languages should be similar. The other thing you can do with stacks</p>



<p>We haven&#8217;t done that yet, but let me show it to you first.</p>



<p>POP usually comes in two forms,</p>



<p>depending on what implementation you&#8217;re looking at.</p>



<p>So sometimes POP returns nothing.</p>



<p>It simply removes an item from the top of the stack.</p>



<p>And sometimes it returns a copy of the item</p>



<p>that you&#8217;re actually removing.</p>



<p>So I&#8217;m going to put like stack here and then like stack</p>



<p>just to show you that it&#8217;s inside of the namespace.</p>



<p>Oh, I don&#8217;t know.</p>



<p>Maybe that&#8217;s too C++y.</p>



<p>I&#8217;ll get rid of that stuff.</p>



<p>Hold on.</p>



<p>hold on so we&#8217;ll maybe do this just to show you that we have three separate</p>



<p>parts to this little code snip so sometimes pop doesn&#8217;t give you a copy of</p>



<p>the thing it removes sometimes it gives you a copy of the thing it removes in</p>



<p>cases where pop does not give you a copy of the thing it removes then you would</p>



<p>probably want to call top right before you popped and top will return a copy of</p>



<p>Just to clarify, if I wanted to remove something and get a copy of it and I had this line 13</p>



<p>form of pop from whatever implementation I was using, then well, I would just call pop</p>



<p>and I would do something like this, you know, auto element equals, you know, the stack dot</p>



<p>pop.</p>



<p>And what would happen is under the hood, it removes the item and then it also returns</p>



<p>a copy to me.</p>



<p>Sorry for being too C++ in this video.</p>



<p>On the other hand, if I have the form that has void for pop,</p>



<p>then I would have to do something like this.</p>



<p>I&#8217;d have to say auto element equals stack.top just to get a copy first,</p>



<p>get a copy of that for before I remove it.</p>



<p>And then when I&#8217;m finished, then I can say s.pop just to grab a copy of it and then remove it.</p>



<p>So for now, we&#8217;re just going to use the form that gives you a copy of the data</p>



<p>at the same time that you&#8217;re removing it.</p>



<p>thing to keep in mind let&#8217;s see there are two other functions i wanted to mention mention real</p>



<p>fast so for now i&#8217;m going to say that we only have the t pop type you can also check to see if a stack</p>



<p>is uh is empty and you can also check its size uh usually those are functions that have those names</p>



<p>but i&#8217;m going to do let&#8217;s see boolean empty and then i&#8217;m going to say size type size again sorry</p>



<p>an unsigned 64-bit integer so just like a count or a size something that&#8217;s just</p>



<p>going to be a whole number and never negative so we have this little</p>



<p>interface that this data structure has and we have been calling push so far so</p>



<p>let&#8217;s go ahead and do some pops I&#8217;m gonna say auto auto elements equals s</p>



<p>dot pop maybe I&#8217;ll do two of those in a row maybe instead of calling that</p>



<p>just so that we can have different variables to put our pops in.</p>



<p>And then maybe after that, I&#8217;ll do some more pushes.</p>



<p>I&#8217;ll say, let&#8217;s push like a 15 and let&#8217;s push like a 25.</p>



<p>And then I think that means it&#8217;s probably time to erase that,</p>



<p>the top part of the diagram with the 8, 2, 3, 4</p>



<p>in favor of just whatever pushes and pops we&#8217;re doing.</p>



<p>So let me just do this real fast.</p>



<p>Okay, so we did our pushes.</p>



<p>two three four and then I&#8217;m going to try to grab a couple pieces of data with these pops</p>



<p>and for pop all you have to do is just to well I should have mentioned this before but first</p>



<p>check to make sure that there is something to pop for example if I had a blank stack let&#8217;s say I had</p>



<p>a blank stack right here there&#8217;s just like nothing on it and this green line is non-standard I&#8217;m just</p>



<p>drawing it for fun but imagine I had a blank stack with no items and I decided to call pop on it</p>



<p>well you&#8217;re not allowed to pop them an empty stack there&#8217;s nothing there to pop which means that&#8217;s a</p>



<p>stack there&#8217;s nothing there to pop which means that&#8217;s a really really naughty thing in c++ and</p>



<p>other languages we would say that something exceptionally bad has happened the user tried</p>



<p>to pop something that wasn&#8217;t there and so then we would do something called throwing an exception</p>



<p>at the user again this is not really a code video but if you know a little code hopefully you</p>



<p>understand try catch blocks and throwing exceptions when bad things happen so we would just throw an</p>



<p>exception at the user if you don&#8217;t know how to code at this point then just keep in mind we would</p>



<p>mind we would refuse to do it we would say something bad has happened we can&#8217;t do that</p>



<p>and then when you&#8217;re doing your pushes sometimes depending on what what you&#8217;re using to implement</p>



<p>the stack under the hood inside of your code you might decide that you&#8217;re using let&#8217;s say you&#8217;re</p>



<p>using an array under the hood which has a fixed capacity if you run out of capacity and you can&#8217;t</p>



<p>then you would throw if the user tried to push something into a full stack we would call that a</p>



<p>stack overflow and then when we tried to pop from an empty stack we would call that stack underflow</p>



<p>but for the purposes of this video just assume that the stack is just a diagram and it has no</p>



<p>capacity so we can just add as many things as we want on it or maybe we&#8217;re using a linked list</p>



<p>under the hood which would have an unlimited capacity or limited only by the machine&#8217;s</p>



<p>But anyway, so let&#8217;s go ahead and try to do this pop.</p>



<p>So let&#8217;s do a pop here.</p>



<p>Well, in the pop, we just look at the top only, right?</p>



<p>So we say, well, you know what?</p>



<p>Let&#8217;s make this more interesting.</p>



<p>Hang on a second.</p>



<p>Let&#8217;s make this more interesting.</p>



<p>Let&#8217;s do this.</p>



<p>I&#8217;m going to do auto a equals s dot top.</p>



<p>So I&#8217;m going to grab a value without actually removing it.</p>



<p>Okay.</p>



<p>So more interesting.</p>



<p>So we push the 8 and we push the 2.</p>



<p>So at that point in time, actually let&#8217;s trace this from scratch.</p>



<p>So we have like an empty stack here.</p>



<p>There&#8217;s nothing there.</p>



<p>And we&#8217;re going to push the 8.</p>



<p>So the 8 goes on the very top, just like we did last time.</p>



<p>I&#8217;m going to put an 8 there.</p>



<p>And then we&#8217;re going to push the 2 next.</p>



<p>So the 2 just kind of goes on top.</p>



<p>And then the next line, line 12, we&#8217;re just checking the top.</p>



<p>we&#8217;re allowed to actually look at the top if we want to. So since two is at the top, that means</p>



<p>a is equal to two. I&#8217;m going to put a two here to remind ourselves that a is now equal to two.</p>



<p>Then we&#8217;re going to do a push three. So I&#8217;m just going to stick a three on top of the stack.</p>



<p>And then we&#8217;re going to push a four, four is on top of the stack. Now, again, we&#8217;re not allowed</p>



<p>to look at anything in the middle, anything, anything, but the top. So for example, when the</p>



<p>it and remove it but now that we have a four on top we can no longer even see the three it&#8217;s not</p>



<p>available to us anymore so then we&#8217;re going to pop and put that value into b so um you know what&#8217;s</p>



<p>at the very top it&#8217;s a four so that means we&#8217;re going to actually remove the four and stick that</p>



<p>into b so i&#8217;m going to put four right here to remind ourselves that b is now equal to four</p>



<p>and uh for the purposes of this video you can just imagine that this you know the top of the stack is</p>



<p>of the stack is just totally gone deallocated depending on what implementation you use you</p>



<p>might want to think about crossing it out maybe there&#8217;s like some junk data there now but for the</p>



<p>purposes of this video in this diagram we&#8217;re just saying it&#8217;s gone so it&#8217;s just totally gone</p>



<p>okay then let&#8217;s do another pop so we&#8217;re going to pop and that&#8217;s going to become c so obviously the</p>



<p>top is uh is now the three so that means the three is going to go into the c variable so here&#8217;s a</p>



<p>c variable so here&#8217;s a three right there then the three gets deallocated</p>



<p>and now the top is the two so then we&#8217;ll push a 15 and we&#8217;ll push a 25 so again we just put those</p>



<p>new items on top of the stack even if there was stuff uh there before it&#8217;s gone now so we&#8217;re just</p>



<p>be a 15 and a 25 on top of the stack so we got this and then 25 and then we&#8217;re done adding our</p>



<p>stuff so uh the other functions that we talked about are empty and size uh at the very beginning</p>



<p>when we had just an empty stack like that if we were to call on the empty function it would tell</p>



<p>us true the stack is empty and then every step after that where we had some data in the stack</p>



<p>data in the stack like as soon as we even added that eight at the very beginning from that point</p>



<p>forward then empty would have returned false to us saying no the stack is uh it&#8217;s not empty</p>



<p>the size would have changed uh during every step of the way so you know at line 10 the size would</p>



<p>have been one after we&#8217;re finished with line 10 after line 11 the size would have been 2. 12</p>



<p>wouldn&#8217;t have changed the size so it still would have been 2. 13 would have upgraded the size to</p>



<p>have upgraded the size to four once we popped after that pop was finished it would have been</p>



<p>three again then the second pop would have brought it back down to two and then those two pushes</p>



<p>would have put it back up to three and then four and so then the final size whoops that was horrible</p>



<p>the final size of the stack is four and you can tell that there&#8217;s just four items</p>



<p>another way to double check yourself if you&#8217;re kind of trying to trace this on your own is just</p>



<p>count the number of pushes and subtract the number of pops so how many pushes do we have one two three</p>



<p>2, 3, 4, 5, 6.</p>



<p>So that&#8217;s like 6 minus however many pops we saw.</p>



<p>We see 2 pops.</p>



<p>So 6 minus 2 is equal to 4.</p>



<p>So, you know, when you&#8217;re writing this sort of thing down on,</p>



<p>like as a diagram to practice,</p>



<p>then you know it&#8217;s a 4 just by looking.</p>



<p>But what if you did something wrong?</p>



<p>It&#8217;s a great idea to double check yourself at all times.</p>



<p>So 6 minus 2 is 4.</p>



<p>So we know that the size of the stack is 4.</p>



<p>Looks pretty good.</p>



<p>Looks pretty good and we know the values of A, B, and C and you know one of those was</p>



<p>top two of those were pops.</p>



<p>And yeah, okay.</p>



<p>So notice something though that&#8217;s kind of peculiar about the data that came out.</p>



<p>If we added the data, like I guess while we were adding the data, we added first an eight</p>



<p>and then a two and then a three and then a four.</p>



<p>I&#8217;m just looking at the pushes right now and then a 15 and then a 25, right?</p>



<p>So we added the data in that order.</p>



<p>order. But then when we grab the data out, let me put this in, but maybe like a red bracket</p>



<p>or something. When we grab data out of it, the pops and the tops gave us two and then</p>



<p>a, okay, nevermind. That was not a pop. It gave us a four and then a three if we&#8217;re just</p>



<p>look at the, look at the first two items. Sorry, sorry, sorry. Look at the last two items right</p>



<p>before, and I didn&#8217;t draw this very well. Imagine that we had just pushed the eight and the two and</p>



<p>the three and the four only forget about these other pieces of data. So at this point, when we</p>



<p>start calling our pops, we have only an eight, two, three, four stack, right? So the data that</p>



<p>has a four and then a three if we&#8217;re removing data from the stack.</p>



<p>So notice how the four and the three are backwards.</p>



<p>Notice also like if we kept popping out data, you know, we got the four and then we got</p>



<p>the three, the next, what&#8217;s the next thing that would come out?</p>



<p>It would be the 25, right?</p>



<p>And then it would be the 15.</p>



<p>And then it would be the two.</p>



<p>And then it would be the eight.</p>



<p>So if you really think about it, the stack is reversing our input data.</p>



<p>We added a three and then a four, but we received a four and then a three.</p>



<p>And of course, it&#8217;s a little bit muddled because we have some pushes in between some tops and pops and stuff.</p>



<p>But just looking at what goes into the stack, it&#8217;s backwards, right?</p>



<p>Eight, two, 15, 25.</p>



<p>Let me finish this push sequence up here.</p>



<p>So we added three and four, and then we added a 15.</p>



<p>And then, oh, my penmanship, dude.</p>



<p>shit dude 15 and then we added a 25 so if you look at the data that comes out this is like a 15 and a</p>



<p>25 backwards and then the three and the four are backwards and then the two and the eight are also</p>



<p>backwards and so one thing that a stack does is it reverses data let me give you a cleaner example</p>



<p>with no pops in between the pushes just to show you what we&#8217;re talking about a little bit more</p>



<p>bit more clearly okay so i&#8217;m going to do maybe like another code page here whoops do that and</p>



<p>then i&#8217;m going to say got our stack and we&#8217;re just going to push in some data</p>



<p>and then we&#8217;ll just say s.pop and maybe i&#8217;ll just do that however many times</p>



<p>six two three four five six so now just a very quick trace because this is basically the same</p>



<p>intermixed. So I&#8217;m going to do like the bottom of the stack here. And then, well, I mean like an</p>



<p>empty stack. That&#8217;s not really a bottom of a stack. So we&#8217;re going to push an eight.</p>



<p>And then we&#8217;re going to push a two. And then we&#8217;re going to push a three. And then we&#8217;re</p>



<p>going to push a four. Then a 15. Got to work on my fives, dude. Okay. And then 25.</p>



<p>Okay, one more time.</p>



<p>Oh yeah, I guess I got to slow down.</p>



<p>So what&#8217;s going to come out?</p>



<p>Remember the top is the only place that will give us data.</p>



<p>So if we start popping all these one by one, we&#8217;re going to end up with a 25 for that first</p>



<p>pop.</p>



<p>Maybe I should write it down over here.</p>



<p>Do like a 25 and maybe I&#8217;ll add some line breaks in the code here so that it&#8217;s easier</p>



<p>for me to write with a pen.</p>



<p>Do this and that.</p>



<p>Okay, so the 25, I&#8217;m just going to do a red line through it to designate or to denote</p>



<p>deallocation or just like gone-ness.</p>



<p>Then the top is at the 15.</p>



<p>We do another pop.</p>



<p>It&#8217;s going to be 15.</p>



<p>Oh, I did my first perfect five today.</p>



<p>And then the top of the stack is now at the four.</p>



<p>So then the four is going to pop out next.</p>



<p>And then the three is going to pop out next.</p>



<p>The top is now at the three.</p>



<p>the three so the three is coming out for that pop we deallocate the three the top goes down one and</p>



<p>then we pop it becomes the two that&#8217;s deallocated now and then we grab the eight because that&#8217;s</p>



<p>where the top is so now we&#8217;ve grabbed all of our data out and I just want you to look at this one</p>



<p>more time notice the data is eight that the data that went in was eight two three four fifteen twenty</p>



<p>The data that came out was backwards 25, 15, 4, 3, 2, 8 or 8, 2, 3, 4, 15, 25.</p>



<p>If you kind of like look up.</p>



<p>So a stack is a data reverser.</p>



<p>A stack is also known as something called a, let&#8217;s see,</p>



<p>last in first out data structure, LIFO,</p>



<p>or first in last out, phylo data structure.</p>



<p>What that basically means is just it&#8217;s reversing the data or priority goes to the item that is the youngest.</p>



<p>So if you looked at the stack at the point where we were about to remove the 25,</p>



<p>25 was the most recently added or the youngest item or the item with, I guess, the timestamp, the furthest in the future,</p>



<p>however you want to look at it.</p>



<p>And that&#8217;s the item that came out.</p>



<p>So if you think about it, it was the last item in.</p>



<p>And therefore, when we did another pop, it was the first item out.</p>



<p>So LIFO or PHILO.</p>



<p>and uh you know this eight down here that was obviously the last item that we were able to grab</p>



<p>out of it so when we said you know hop our final pop before the stack became empty uh the eight was</p>



<p>definitely the first item in so first in was the last out if you really want to you can kind of like</p>



<p>jumble these uh these acronyms uh i think most like people just use lipo or phylo</p>



<p>life if you say something to me that I understand I think it&#8217;s probably fine</p>



<p>but it&#8217;s it&#8217;s non-standard I like to say you know foley first out last in that</p>



<p>definitely makes sense it&#8217;s just not very common another thing that I like to</p>



<p>do for fun is also I&#8217;ll mix up the phylo and I&#8217;ll say lo-fi because last out is</p>



<p>first in and now I&#8217;m cooler than other computer people because I use the word</p>



<p>lo-fi I&#8217;ve now got like a giant mustache and like a little like swap meet shirt</p>



<p>like swap meat shirt and I have craft beers and I have work boots on and I&#8217;d</p>



<p>roll up my jeans and my, my, my, my, my sleeves are rolled up and all that stuff.</p>



<p>You know what I&#8217;m saying?</p>



<p>I&#8217;m cooler than everybody else now because I used loaf pie anyway.</p>



<p>So we used integers.</p>



<p>It&#8217;s just important to understand that in modern coding,</p>



<p>I think I might&#8217;ve mentioned this before with the T&#8217;s,</p>



<p>these stacks are templated data structures,</p>



<p>we can hold another data type besides integers as long as we declare what the stack will hold in</p>



<p>advance. So instead of integers, you could imagine there&#8217;s like a custom class, like my class,</p>



<p>every single, you know, item in the stack is actually a full instance of a my class object,</p>



<p>or, you know, floats or strings or just, you know, any data structure you want,</p>



<p>you could put another data structure inside of a stack. People do that sometimes just for fun,</p>



<p>sometimes just for fun you could take a vector and stick it inside of a stack a list put it inside</p>



<p>of a stack you know whatever you want to do just to show that you understand everything</p>



<p>um so again by the way the stack is empty if we tried to pop from it at this point</p>



<p>this would be called a stack underflow we would probably want to throw an exception at the user</p>



<p>or just say we&#8217;re not allowed to do it let&#8217;s see um so i guess now i should tell you some</p>



<p>common uses for stacks i&#8217;m looking at my notes right here uh obviously our stack has reversed</p>



<p>has reversed the data. So stacks are kind of good for data reversing. Imagine if you had like a word</p>



<p>and you wanted to detect if the word was a palindrome or not, you would just like put all</p>



<p>the letters of the word into your stack and then grab them back out and see if the word was still</p>



<p>in the same order. If it was, then your word was probably a palindrome. If you don&#8217;t remember what</p>



<p>a palindrome is, I&#8217;m going to write down the word radar in reverse from backwards, from back to</p>



<p>front, right? It&#8217;s the same word. So that&#8217;s a palindrome. You could also use stacks kind of</p>



<p>as a trail of breadcrumbs. Like you could imagine that early implementations of browsers</p>



<p>had your browsing history in a stack somewhere so that every time you visited a webpage, then</p>



<p>some kind of block of information, maybe like a custom class instance was put onto a stack</p>



<p>somewhere and it contained information about like when you visited the webpage, what the URL was,</p>



<p>it is that the browser wants to remember and then later when you hit the back button then you can</p>



<p>imagine the browser is popping from the stack in order to go backwards in your history or your</p>



<p>spotify playlist or whatever it is you&#8217;re doing honestly you know these systems are much more</p>



<p>advanced than just using you know vanilla stacks now but you could imagine doing something on your</p>



<p>own for fun or just what it might have been like in the very beginning i&#8217;m going to erase fully</p>



<p>because that&#8217;s just that&#8217;s just that&#8217;s just cringe lo-fi i think is way cooler um so trail of bread</p>



<p>So a trail of breadcrumbs, like browser history, you could also imagine undo history, like</p>



<p>if you had a, I don&#8217;t know, like a text editor of some sort or like a image editor of some</p>



<p>sort, every major change that you did to it, maybe the program under the hood is adding</p>



<p>your change to the stack.</p>



<p>And that makes it easier to sort of reverse your changes as those changes are popped.</p>



<p>And there&#8217;s like a sort of mathematical uses like balancing parentheses and things, but</p>



<p>balancing parentheses and things, but I&#8217;m not going to talk about that too much.</p>



<p>And one of the most important uses for stacks inside of your computer is actually the call</p>



<p>stack. I&#8217;m going to talk about that in a future video. But again, remember each, you know, little</p>



<p>item on the stack, it could be a different data structure on its own. It doesn&#8217;t have to be an</p>



<p>integer. So imagine that I bundled up a bunch of information about a function call, and I called it</p>



<p>I just stuck a call frame on the stack.</p>



<p>That&#8217;s basically the call stack.</p>



<p>But that&#8217;s for another video.</p>



<p>Anyway, so let&#8217;s see.</p>



<p>Is there anything else that I wanted to show you?</p>



<p>I think we&#8217;re actually done just talking about the basics of stacks.</p>



<p>I&#8217;m not talking about time complexities or anything like that in this video.</p>



<p>Check a future video if you&#8217;re interested in time complexities per certain implementations</p>



<p>and so forth.</p>



<p>But for now, this is how a stack works.</p>



<p>or LIFO or LOFI data structure.</p>



<p>Nobody&#8217;s going to say LOFI but me, just FYI.</p>



<p>But maybe everybody will start doing it now.</p>



<p>I don&#8217;t know.</p>



<p>If it becomes a trend, okay?</p>



<p>You heard it here first.</p>



<p>Give everybody this link.</p>



<p>All right, I hope you feel like an expert on stacks</p>



<p>at this point.</p>



<p>I hope you had a little bit of fun</p>



<p>and learned a little bit of something, some stuffs.</p>



<p>I&#8217;ll see you in the next video.</p>



<p>hey everybody thanks for watching this video again from the bottom of my heart I really</p>



<p>appreciate it I do hope you did learn something and have some fun if you could do me a please a</p>



<p>small little favor could you please subscribe and follow this channel or these videos or whatever it</p>



<p>is you do on the current social media website that you&#8217;re looking at right now it would really mean</p>



<p>the world to me and it&#8217;ll help make more videos and grow this community so we&#8217;ll be able to do</p>



<p>videos, longer videos, better videos, or just I&#8217;ll be able to keep making videos in general. So please</p>



<p>do me a kindness and subscribe. You know, sometimes I&#8217;m sleeping in the middle of the night</p>



<p>and I just wake up because I know somebody subscribed or followed. It just wakes me up</p>



<p>and I get filled with joy. That&#8217;s exactly what happens every single time. So you could do it as</p>



<p>a nice favor to me or you could you could troll me if you want to just wake me up in the middle</p>



<p>of the night, just subscribe and then I&#8217;ll just wake up. I promise that&#8217;s what will happen.</p>



<p>Also, if you look at the middle of the screen right now, you should see a QR code which you can scan in order to go to the website</p>



<p>which I think is also named somewhere at the bottom of this video and</p>



<p>It&#8217;ll take you to my main website where you can just kind of like see all the videos</p>



<p>I published and the services and tutorials and things that I offer and all that good stuff and</p>



<p>If you have a suggestion for</p>



<p>Clarifications or errata or just future videos that you want to see</p>



<p>please leave a comment or if you just want to say hey what&#8217;s up what&#8217;s going on you know just send</p>



<p>me a comment whatever i also wake up for those in the middle of the night i get i wake up in a cold</p>



<p>sweat and i&#8217;m like it would really it really mean the world to me i would really appreciate it so</p>



<p>again thank you so much for watching this video and um enjoy the cool music</p>



<p>as as i fade into the darkness which is coming for us all</p>



<p>Thank you.</p>
<p>The post <a href="https://www.NeuralLantern.com/master-stacks-fun-guide-to-data-structures-lifo-real-world-uses/">Master Stacks: Fun Guide to Data Structures, LIFO &amp; Real-World Uses</a> appeared first on <a href="https://www.NeuralLantern.com">NeuralLantern.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.NeuralLantern.com/master-stacks-fun-guide-to-data-structures-lifo-real-world-uses/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Logic Gates Crash Course: Learn AND, OR, XOR, NOT &#038; Build Circuits</title>
		<link>https://www.NeuralLantern.com/logic-gates-crash-course-learn-and-or-xor-not-build-circuits/</link>
					<comments>https://www.NeuralLantern.com/logic-gates-crash-course-learn-and-or-xor-not-build-circuits/#respond</comments>
		
		<dc:creator><![CDATA[mike]]></dc:creator>
		<pubDate>Sun, 06 Jul 2025 13:41:22 +0000</pubDate>
				<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[AND gate]]></category>
		<category><![CDATA[beginner electronics]]></category>
		<category><![CDATA[binary logic]]></category>
		<category><![CDATA[circuit design]]></category>
		<category><![CDATA[computer engineering]]></category>
		<category><![CDATA[computer science basics]]></category>
		<category><![CDATA[digital electronics]]></category>
		<category><![CDATA[digital logic]]></category>
		<category><![CDATA[logic circuits]]></category>
		<category><![CDATA[logic gates]]></category>
		<category><![CDATA[NOT gate]]></category>
		<category><![CDATA[OR gate]]></category>
		<category><![CDATA[tech tutorials]]></category>
		<category><![CDATA[truth tables]]></category>
		<category><![CDATA[XOR gate]]></category>
		<guid isPermaLink="false">https://www.NeuralLantern.com/?p=176</guid>

					<description><![CDATA[<p>Learn logic gates (AND, OR, XOR, NOT) with diagrams &#038; circuits. Fun, clear intro to digital logic for beginners.</p>
<p>The post <a href="https://www.NeuralLantern.com/logic-gates-crash-course-learn-and-or-xor-not-build-circuits/">Logic Gates Crash Course: Learn AND, OR, XOR, NOT &amp; Build Circuits</a> appeared first on <a href="https://www.NeuralLantern.com">NeuralLantern.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<iframe title="Logic Gates Crash Course: Learn AND, OR, XOR, NOT &amp; Build Circuits" width="1380" height="776" src="https://www.youtube.com/embed/ah5DzK_VJr0?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
</div></figure>



<p>Hey there! In this video, I’m diving into the world of logic gates &#8211; AND, OR, XOR, and NOT. We’ll break down how each gate works, draw them in ANSI style, and rig up a circuit to see how they turn inputs into logical outputs. I’ll walk you through truth tables and show you how to chain gates for cool results, all while keeping it real and relatable. Whether you’re new to digital logic or just want a refresher, this is for you. Got questions? Drop a comment! Subscribe to join the crew, and scan the QR code to check out my site for more tutorials. Let’s geek out together!</p>



<p>Introduction to Logic Gates 00:00:00<br>Overview of AND Gate 00:00:47<br>Overview of OR Gate 00:01:07<br>Overview of XOR Gate 00:01:24<br>Overview of NOT Gate 00:01:49<br>Drawing AND Gate 00:02:14<br>Drawing OR Gate 00:03:07<br>Drawing XOR Gate 00:04:12<br>Drawing NOT Gate 00:05:31<br>Building a Circuit 00:06:04<br>Combining Gates 00:07:21<br>Testing with All Zeros 00:09:56<br>Testing with All Ones 00:11:23<br>Testing with Random Inputs 00:12:32<br>Introduction to Truth Tables 00:15:00<br>Creating Truth Tables 00:16:03<br>Analyzing Circuit with Truth Tables 00:18:50<br>Hierarchical Truth Table Approach 00:20:04<br>Final Circuit Analysis 00:26:36<br>Conclusion and Call to Action 00:29:15</p>



<p>Thanks for watching!</p>



<p>Find us on other social media here:</p>



<ul class="wp-block-list">
<li>https://www.NeuralLantern.com/social</li>
</ul>



<p>Please help support us!</p>



<ul class="wp-block-list">
<li>Subscribing + Sharing on Social Media</li>



<li>Leaving a comment or suggestion</li>



<li>Subscribing to our Blog</li>



<li>Watching the main &#8220;pinned&#8221; video of this channel for offers and extras</li>
</ul>



<p>Okay, hey everybody! In this video I&#8217;m going to talk about logic gates. I&#8217;m going to show you</p>



<p>AND, OR, XOR, and NOT. We&#8217;re going to draw them in a diagram style and we&#8217;re going to rig up a</p>



<p>bunch against each other and see if we can figure out how they would process some input data into</p>



<p>you know some logical output.</p>



<p>Okay so for starters let&#8217;s just go over what the gates look like. If you don&#8217;t know how these gates</p>



<p>don&#8217;t know how these gates work check my previous videos because I&#8217;ve explained them there. Here I&#8217;m</p>



<p>just going to sort of try to draw them and make a little big a little circuit area that we can play</p>



<p>with. Okay so AND. Okay you know what you want me to I&#8217;ll just do a quick recap. The AND gate just</p>



<p>means that both bits have to be a 1 in order for a 1 2 output so if we do a 0 and a 0 and a 1 and</p>



<p>sorry one and a zero and a one and a one then only this one is going to end up being a one</p>



<p>everything else is going to be a zero for the logical or it&#8217;s going to be if we do zero zero</p>



<p>zero one one zero and one one and if this is too fast and confusing for you see my other videos</p>



<p>but basically it&#8217;s going to be a one for those three because if either of those bits are a one</p>



<p>then the output is going to be a one and the only place it&#8217;ll be a zero is when both of the bits are</p>



<p>Let&#8217;s look at XOR. So XOR is</p>



<p>Basically and it&#8217;s an OR except this one position right here where both bits are a one that would end up being a zero</p>



<p>So for XOR 0 0 0 1 1 0 1 1</p>



<p>It&#8217;s going to be a 0 and</p>



<p>Then a 1 and then a 1 and then a 0 so it&#8217;s just a little bit different from OR and then not just inverts the bits</p>



<p>so</p>



<p>bit at a time and it&#8217;s just a zero becomes a one and a one becomes a zero and that&#8217;s pretty much it</p>



<p>okay so maybe I should put not right here just to just to emphasize that I&#8217;m talking about not</p>



<p>okay I&#8217;m definitely not not talking about not sorry so let&#8217;s do uh let&#8217;s draw a logical or a</p>



<p>bitwise and gate it&#8217;s basically just kind of like this and then there&#8217;s a little flat ridge at the</p>



<p>end of it and it takes two inputs there are many different styles to draw these kinds of gates but</p>



<p>i&#8217;m going to use the ansi style i think for the most part so just keep in mind you know you can</p>



<p>draw these in many different ways it&#8217;s going to take two inputs imagine this is a little circuit</p>



<p>right here and it&#8217;s going to give you one output so if you imagine what we talked about before</p>



<p>we could send it two different bits and it will produce the output for us so if we give it a zero</p>



<p>for us. If we give it a 0 and a 1, it&#8217;s still going to output a 0. If we give it a 1 and a 0,</p>



<p>still a 0. If we give it a 1 and a 1, then finally it&#8217;ll actually give us a 1.</p>



<p>Okay, so that&#8217;s just the way that gate looks. And now I&#8217;m going to draw the next one.</p>



<p>Let&#8217;s draw the OR. So maybe I&#8217;ll put OR here. Whoops. Oh, I got to do that. OR. So the OR gate</p>



<p>kind of looks like the AND gate at least in the style that I&#8217;m drawing except the</p>



<p>the flat ridges is more curved like this so you know an AND gate I&#8217;ll draw it in</p>



<p>red just to remind you that this is not what we&#8217;re doing right now it&#8217;s you know</p>



<p>flat right where&#8217;s the OR gate it has a curve it&#8217;s like a crescent moon kind of</p>



<p>it still takes two inputs so I&#8217;m gonna do an input here and an input here and</p>



<p>it still has one output and so if we&#8217;re just gonna give it a zero and a zero it&#8217;s</p>



<p>give it a zero and a zero it&#8217;s going to output zero for us if we give it a zero</p>



<p>and a one it&#8217;s going to output a one if we give it a one and a zero it&#8217;ll still</p>



<p>output a one if we give it a one and a one it&#8217;ll still output a one okay that</p>



<p>was pretty easy let&#8217;s look at exclusive or so XOR XOR the XOR gate looks like</p>



<p>like the ore gate so i&#8217;m going to start by trying to draw an ore gate as best i can</p>



<p>which is not good oh god let me start over on that one let me try one more time and then i&#8217;ll just</p>



<p>give up okay do this and then i&#8217;ll say okay that was good enough and then it has another line right</p>



<p>here the line is supposed to be parallel to the uh the crescent moon you know the curved side but</p>



<p>and that way it sort of looks like the inputs are passing through</p>



<p>like the first line before they touch the actual ridge.</p>



<p>So that&#8217;s an exclusive or it also outputs one bit.</p>



<p>So just practicing, we&#8217;ll give it two zeros.</p>



<p>It&#8217;s going to output a zero because there&#8217;s no or involved in two zeros</p>



<p>or I guess there&#8217;s no orness to the two zeros.</p>



<p>If we give it a zero and a one, then that&#8217;s going to output a one</p>



<p>one input is a one if we give it a one and a zero same thing looks good because</p>



<p>one input was a one but then once we get to two inputs then it&#8217;s going to output</p>



<p>a zero because the exclusive or demands that only one of the bits is a one and</p>



<p>actually exactly one of the bits is a one to produce a one okay so then the</p>



<p>next thing that I can show you is a knot gate it&#8217;s sort of like a little triangle</p>



<p>are different drawing styles it takes only one input and then there&#8217;s like a little circle up</p>



<p>here on top and then it outputs at the top and so if we give it a zero it&#8217;s going to output a one</p>



<p>i guess i could draw it a second time since there&#8217;s only you know two things we can we can input to it</p>



<p>it&#8217;s going to give us a zero if we inputted a one into it so it just reverts it&#8217;s an inverter</p>



<p>helps you understand the basics of these types of gates. Now I&#8217;m going to try to make a bunch of</p>



<p>them see if I can come up with something interesting on the fly. I had problems with</p>



<p>the drawing system on my other computer so I didn&#8217;t really prepare an example. Hopefully this</p>



<p>is good you never know. I&#8217;m just going to draw an AND gate here and I&#8217;ll say that it takes two</p>



<p>inputs because that&#8217;s what it does and then right next to it maybe I&#8217;ll do an exclusive OR so I&#8217;ll</p>



<p>like an OR gate here, and then I&#8217;ll do the exclusive OR part of it, and I&#8217;ll give it</p>



<p>two inputs because that&#8217;s what they take.</p>



<p>And then next to that, maybe I&#8217;ll just do a regular OR.</p>



<p>We&#8217;ll say OR, just like that.</p>



<p>Oh, that&#8217;s awful.</p>



<p>Try one more time.</p>



<p>Just do this, and then say this.</p>



<p>Okay, that&#8217;s acceptable, sort of.</p>



<p>We&#8217;ll do two more inputs there.</p>



<p>And what else can I do?</p>



<p>What else can I do?</p>



<p>Should I do another exclusive or or an and?</p>



<p>What do you think?</p>



<p>Vote.</p>



<p>Just kidding.</p>



<p>I&#8217;m going to do an and right here.</p>



<p>So I&#8217;m kind of repeating one of the gates.</p>



<p>Let&#8217;s see.</p>



<p>And or X or not.</p>



<p>Yeah, that&#8217;s all I wanted to talk about.</p>



<p>Okay, so now we can combine them because remember these have an output.</p>



<p>But if we sort of use the outputs of two of the gates as input for another gate,</p>



<p>then we can you can we can sort of like chain uh our circuits to make something a little bit more</p>



<p>interesting so maybe here i&#8217;ll do an and i&#8217;ll say this is an and gate oh god that&#8217;s awful</p>



<p>one more time okay my text-to-speech engine who i&#8217;ve given the personality of mary poppins</p>



<p>is telling me that a door is open so i&#8217;ve got to close the door after this video anyway</p>



<p>video anyway um yeah I have like an LLM server uh in the other room and so now my home assistant</p>



<p>is a little bit smarter and sometimes she messes with me that&#8217;s a story for another video</p>



<p>so I&#8217;m combining the output of both of those gates and sticking them into an and</p>



<p>and then I can do the same thing here I think I drew those I think I drew it like way too high</p>



<p>I&#8217;m gonna run out of room let me try one more time put that there we&#8217;ll do an and gate</p>



<p>gate like that and then I&#8217;ll just maybe curve the wires so it seems like uh it makes more sense okay</p>



<p>and then maybe over here I&#8217;ll do uh I don&#8217;t know maybe this should be an or I&#8217;ll do an or gate</p>



<p>like that and then the inputs from the other ones go into the or gate</p>



<p>then these two can combine to one more so maybe I&#8217;ll do exclusive or</p>



<p>or I guess I&#8217;ll just put an or gate here and then I will that&#8217;s not that&#8217;s not</p>



<p>curvy enough is it I like my Alex might I like my XOR gates nice and curvy so</p>



<p>we&#8217;ll do this and then I&#8217;ll put another line under it and then we&#8217;ll connect</p>



<p>these two so we&#8217;ll do this okay so then finally we have like one bit that&#8217;s</p>



<p>one bit that&#8217;s going to come out at the top let&#8217;s use the knot gate might as well so i&#8217;m going to</p>



<p>connect this to a knot gate and put a little circle on top of it and then it will give us our</p>



<p>final output and maybe i&#8217;ll stick it here in green or something like that okay so there&#8217;s lots of</p>



<p>different uh input output combinations we could use uh let&#8217;s see for every input we have that&#8217;s</p>



<p>one bit so one two three four five six seven eight that&#8217;s eight bits that means i could draw out</p>



<p>256 possible input combinations, which I&#8217;m definitely not going to do in this video.</p>



<p>But let&#8217;s just do some random stuff.</p>



<p>Let&#8217;s start off with zeros just for fun.</p>



<p>So we&#8217;ll do a bunch of zeros here.</p>



<p>So if you sort of look at this diagram, we go, all right, what was that?</p>



<p>This and here, there&#8217;s two zeros.</p>



<p>It&#8217;s going to produce a one.</p>



<p>So I&#8217;m just going to put a one right here to remind me that a one is going to be the</p>



<p>output of that gate.</p>



<p>the OR gate here is going to also output a what am I doing why did I put a one a zero because zero</p>



<p>and zero is zero and then zero or zero is also zero so this is going to output a zero and then</p>



<p>this exclusive OR is also going to output a zero and then the end is zero so I just have zeros at</p>



<p>the next level then we look at the inputs here to this and that&#8217;s obviously going to be zero and</p>



<p>then we look at the OR here that&#8217;s obviously going to be zero and then those two go into the gate</p>



<p>that&#8217;s a little bit higher and it&#8217;s going to output a zero because exclusive</p>



<p>or needs at least, you know, it needs exactly one, uh, one.</p>



<p>So it kind of feels like it&#8217;s going to be a zero for the output, right?</p>



<p>Uh, you&#8217;d be wrong if you thought that because the knot is going to invert it.</p>



<p>The knot is going to take that zero and flip it to a one.</p>



<p>So if we do all zeros, the answer is actually going to be a one.</p>



<p>Okay.</p>



<p>Let&#8217;s reset this and try again.</p>



<p>So I&#8217;m going to just get rid of these greens here.</p>



<p>and then I&#8217;m going to do, maybe I should write the inputs in red so they&#8217;re more fun,</p>



<p>so they don&#8217;t feel like they&#8217;re blending too much in with the actual diagram.</p>



<p>Okay, so now I&#8217;m going to, let&#8217;s try all ones. Let&#8217;s see what happens if we do all ones.</p>



<p>So I&#8217;m going to do ones on every input. One, one, one, one, one, one, one. And so</p>



<p>if we look at this AND gate, it&#8217;s going to output a one because, well, a one and one is a one.</p>



<p>one is a one the or gate same thing because a one or one is a one and then do the same thing down</p>



<p>here for this and and then the exclusive or that&#8217;s going to be a zero because it wants exactly one</p>



<p>bit to be a one not both so it&#8217;s a little bit more interesting and then we go up one level this and</p>



<p>gate is going to output a zero because it wanted both of those uh inputs to be a one for it to</p>



<p>output a one and then for the or it&#8217;s also going to output a well it&#8217;s going to output a one again</p>



<p>both of those are ones and then if we look at the exclusive or oh that&#8217;s going to output a one this</p>



<p>time because exactly one of the inputs is a one then the not is going to invert it so the final</p>



<p>answer is going to be zero for this whole giant thing i want to say make sense and wait for</p>



<p>questions but i guess i can&#8217;t so let&#8217;s try another example i&#8217;m going to do maybe two examples with</p>



<p>totally random numbers and then i&#8217;m going to show you how to write a truth table that might help you</p>



<p>might help you work this out on paper or like a like a notepad if you don&#8217;t really want to draw</p>



<p>so let&#8217;s see um uh i guess i&#8217;m gonna like maybe take some of these and turn these into zeros</p>



<p>let&#8217;s see get rid of that make that a zero maybe like i don&#8217;t know i feel like i&#8217;m not random</p>



<p>enough okay one zero and then like a maybe like a zero here how about like a one there and a zero</p>



<p>How about like a one there and a zero there?</p>



<p>Just one, zero, one, zero, oh, one, oh, one.</p>



<p>That&#8217;s too much of a pattern.</p>



<p>Let me do, let me do a one, oh here, or a one and a one.</p>



<p>Okay.</p>



<p>That feels more random to me.</p>



<p>So looking at the AND gate, that&#8217;s going to output a zero.</p>



<p>The OR gate is going to output a one.</p>



<p>The exclusive OR is going to output a zero.</p>



<p>The AND is going to output a zero.</p>



<p>So we just got a one right there.</p>



<p>So this AND is going to output a zero again.</p>



<p>This OR is going to output a one.</p>



<p>And then the exclusive OR, it&#8217;s got enough to output a one.</p>



<p>it&#8217;s got enough to output a one so that&#8217;s nice and then its final output is going to be</p>



<p>a zero because we had to not that one nice okay let&#8217;s just i don&#8217;t know change a couple random</p>



<p>bits i&#8217;m going to change this well let me erase first and then i&#8217;m going to start changing random</p>



<p>bits i don&#8217;t even remember what that last bit was anymore i&#8217;m going to pretend it was a one</p>



<p>and then i&#8217;m going to change it to a zero and then i&#8217;m going to change this zero to a one</p>



<p>change this one to a zero and then I&#8217;ll change this this zero to a one not like exactly random</p>



<p>it&#8217;s human random sort of so let&#8217;s look at this the and is going to output a one and the exclusive</p>



<p>or is going to do a one and then the or is going to do a one and then the and is going to do zero</p>



<p>one and one zero okay I think I did it right so the or is going to do a one and then I think</p>



<p>what&#8217;s happening is I gotta adjust my penmanship style I still have to like lift up sooner so it</p>



<p>doesn&#8217;t change colors so then the end it&#8217;s going to output a one and then this exclusive or it&#8217;s</p>



<p>going to output a zero because it wants only one bit one input to be a one and then the not is</p>



<p>Okay, let&#8217;s look at the idea of using a truth table to make this a little bit easier to</p>



<p>solve if you&#8217;re just kind of doing this without drawing.</p>



<p>So I&#8217;m not going to clear this just yet.</p>



<p>I might have to clear it in a second.</p>



<p>The first thing that you should do when you&#8217;re making a truth table is, you know, I mean,</p>



<p>I guess you can style this however you want, but you kind of have to think of this hierarchically.</p>



<p>Like what&#8217;s the easiest thing to do?</p>



<p>You don&#8217;t want to start computing the thing at the very top because that depends on a</p>



<p>lot of other stuff that&#8217;s at the bottom.</p>



<p>So instead I&#8217;m going to look at the very bottom row of inputs because they&#8217;re the easiest to calculate.</p>



<p>So I&#8217;m going to do and, I&#8217;m going to say something and something.</p>



<p>I guess I&#8217;m just going to put and by itself.</p>



<p>Maybe I&#8217;ll put one for input.</p>



<p>So for the inputs, I&#8217;ll just do the bits here.</p>



<p>0 1 1 no okay let&#8217;s just use two inputs only because we&#8217;re looking at the lowest level here</p>



<p>yeah and we&#8217;ll make maybe like a separate row or separate table for that so we just have two</p>



<p>inputs per gate on the bottom row and so for the end it&#8217;s going to be a one right then for the 0 1</p>



<p>should just do this in numeric order. I&#8217;ll just do every possible combo because we don&#8217;t have that</p>



<p>many numbers. So we have four combos. This is like zero, one, two, three. So from zero to three or</p>



<p>four possible combos. And then the end is going to be a zero here and a zero there and a zero there.</p>



<p>So that&#8217;s a truth table that just handles that first gate. So then I&#8217;m just going to, you know,</p>



<p>write, I mean, you could make another truth table for this, but I&#8217;m going to try to write this in a</p>



<p>I&#8217;m going to try to write this in a more compact way.</p>



<p>I&#8217;m going to say the second column is the result of ending.</p>



<p>The next column is the result of oaring.</p>



<p>And then the last column is the result of,</p>



<p>maybe second to last is the result of an XOR.</p>



<p>And then maybe I&#8217;ll make another table for nodding.</p>



<p>So what is the result of an OR here?</p>



<p>It&#8217;s going to be a, whoops, a zero.</p>



<p>The OR here is going to be a one.</p>



<p>So when you start to make these tables,</p>



<p>it just makes it a little bit easier to work your way up because when it gets time to let&#8217;s say the</p>



<p>not you don&#8217;t have to compute all the other things because they&#8217;re already computed in the table so</p>



<p>we got the or which i should have probably done first because the second gate was an xor i should</p>



<p>have done that maybe third i don&#8217;t know i&#8217;m going to leave it as and and or right now and then we&#8217;re</p>



<p>going to do xor so xor is basically if exactly one bit is a one will output a one so that&#8217;s a one</p>



<p>so that&#8217;s a one there and then a one there and then a zero there okay so we&#8217;ve got the basics</p>



<p>and if you think about it that&#8217;s the whole bottom row right so if we&#8217;re just sort of looking at</p>



<p>let&#8217;s say the the third gate right here then uh we just have to look at input one one for the or</p>



<p>and then that&#8217;s this right here right there so that tells us what the answer would be truth table</p>



<p>for input zero one we just have to go all right zero one xor the output should be a one</p>



<p>and we can double check ourselves because it&#8217;s really really easy to make mistakes i&#8217;m sure</p>



<p>there&#8217;s a chance that i have or will make a mistake pretty soon</p>



<p>so we did and or an xor let&#8217;s do maybe just one for the knot just to remind ourselves of what it is</p>



<p>and i&#8217;ll just say not and so we can only do two different inputs on the uh on the knot so i&#8217;m</p>



<p>so I&#8217;m going to go maybe a zero and then a one right here and then the not is going to say we</p>



<p>have a one there and a zero there okay so now we can get a little bit more complicated</p>



<p>by combining these terms so for the input now we could do</p>



<p>we could do uh let&#8217;s say two gates at a time so we&#8217;ll do the input here and we&#8217;ll say the input</p>



<p>1, 0, 1.</p>



<p>And so when we not, when we not the, well, when we do an and for the 1, 1, we can end</p>



<p>up with a 1.</p>



<p>And then when we do an XOR on the 0, 1, then this is not the best truth table, to be honest.</p>



<p>I&#8217;m just trying to I&#8217;m just trying to do it the XOR is going to be a one so now we kind of have</p>



<p>the results written down here let&#8217;s do another little table and you know the way these tables</p>



<p>work is you kind of want to put every possible combination of inputs there but that alone is</p>



<p>going to be so many combinations I don&#8217;t want to write it all down and by the time we get to eight</p>



<p>bits it&#8217;s going to be like in the 200s so if we just look at the next pair of gates we&#8217;ll say</p>



<p>gates will say one one zero zero and the first thing is an or for the one one and</p>



<p>then the next thing is an and for the zero zero and so I can just write this</p>



<p>down and go all right the or is going to be a one and the end is going to be a</p>



<p>zero okay so then I can do another level I&#8217;ve pretty much just handled you know</p>



<p>the bottom row here and again each table is supposed to be filled out for every</p>



<p>combination of inputs but I can now just kind of move on to the next row I can say</p>



<p>what is the result of inputting a one and a one you could do that but it might be a little bit</p>



<p>better and closer to some other places that might want you to input this sort of thing</p>



<p>to write down what is the result of the or what is the what are the two gates that are giving you</p>



<p>Okay, so the first input on the very bottom left, that&#8217;s an and, right?</p>



<p>And then the next input on the bottom row is an XOR.</p>



<p>And if we&#8217;re trying to figure out, you know, how are we combining those?</p>



<p>We could say and XOR, or we can do, you know, two ampersands.</p>



<p>I guess I&#8217;m going to do and XOR, just to keep it in plain English as much as I possibly can.</p>



<p>So basically, this is going to have, you know, one result.</p>



<p>this is going to have, you know, one result, you know, one bit result and its input is going to be</p>



<p>a one, one, zero, one. And so maybe I should do another row here. We can say the end</p>



<p>for the end is going to, for one, one is going to be that. And the XOR is going to, well,</p>



<p>I already wrote that down in the table. Okay. I&#8217;m just going to, I&#8217;m just going to clean it up</p>



<p>because you know, it&#8217;s really good in these truth tables. If you write down all</p>



<p>truth tables if you write down all of the numbers, but I&#8217;m just going to do it this.</p>



<p>I&#8217;m just going to do it this.</p>



<p>Maybe we can visually see that there&#8217;s a one one going into the first end and then a zero</p>



<p>one going into the second gate, which is an XOR.</p>



<p>I think maybe that&#8217;s acceptable.</p>



<p>So the result of that, if we just sort of look up at this table here, we have, you know,</p>



<p>what is the end and what is the OR?</p>



<p>It&#8217;s a one and a one.</p>



<p>So if we end those two together, that should be a one.</p>



<p>that should be a one so that means if we end the and against an xor then that&#8217;s the result that we</p>



<p>get and then we&#8217;ll make another little table here for the next layer of inputs so i&#8217;ll just do this</p>



<p>and i&#8217;ll say</p>



<p>or and then the operator that combines them is an or and then on the right side it&#8217;s an and</p>



<p>The input to both of those is going to be a one, one, zero, zero.</p>



<p>And again, you should make another row for every possible combination of inputs.</p>



<p>That would be a really smart idea.</p>



<p>So then I will say that, uh, the, or in the end for a one, one and a zero,</p>



<p>zero is this because we already wrote that down in the truth table.</p>



<p>So really we&#8217;re going to be looking at inputs of one and zero.</p>



<p>So that means, uh, if we&#8217;re applying an, or to that,</p>



<p>applying an or to that, the final result should actually be one.</p>



<p>Okay.</p>



<p>So now we&#8217;ve got that second row.</p>



<p>We just have to look at the second to the last row.</p>



<p>So I&#8217;m going to go input for an X or of something else.</p>



<p>And the X or is going to be, oh gosh.</p>



<p>of an and</p>



<p>well xor let&#8217;s put that in the middle let&#8217;s say and on the left and or on the right and then we&#8217;ll</p>



<p>do an xor against them maybe you could put the parentheses on the other ones i don&#8217;t know i&#8217;m</p>



<p>struggling with notation clearly right now but so we say and exclusive or with the or but then what</p>



<p>Let&#8217;s put some more parentheses around it and we&#8217;ll say the and anded with an X or.</p>



<p>Now we&#8217;re running out of room here.</p>



<p>Can I get this like at the top maybe more?</p>



<p>How about that?</p>



<p>Okay, that&#8217;s a little bit better.</p>



<p>So we have and being anded against an X or and then I put parentheses around that.</p>



<p>There is a, there are special symbols you can use for this to make it more clear, but</p>



<p>for this to make it more clear, but I&#8217;m not really trying to explain that right now.</p>



<p>I just want you to see how the gates work.</p>



<p>So we have, then the next two operators are in, oh gosh, yeah, we&#8217;re XORing against two</p>



<p>things.</p>



<p>So on the right side, the OR is ORing and OR, and then on its right side is the AND.</p>



<p>So maybe I should do, I don&#8217;t know, I guess I&#8217;ll put parentheses right there to make it</p>



<p>seem a little bit more clear.</p>



<p>So now we&#8217;ve basically got an XOR and on its left side what&#8217;s happening underneath it is an</p>



<p>anding which is the middle of an and on the left and an XOR on the right and then the</p>



<p>the right side of the XOR is</p>



<p>then the the right side of the XOR that was my LL I&#8217;m talking to me again</p>



<p>on its left sorry it&#8217;s oaring on its on its right and then under the or it&#8217;s got an or on the left</p>



<p>and an and on the right okay so we&#8217;ve written all these down in a way that&#8217;s okay not great but okay</p>



<p>and i&#8217;m just going to do one one zero one one zero zero and then um i&#8217;ll make another video in the</p>



<p>future about truth tables if everyone is super interested but that&#8217;s that&#8217;s not really what i</p>



<p>I&#8217;ll make a video where the truth tables look proper and nice and full and all that stuff.</p>



<p>So let&#8217;s do, what is the answer between the, oh, I have to scroll up a little bit to see that.</p>



<p>So the left side of the XOR had an anding of an and and an XOR.</p>



<p>So that was this right here.</p>



<p>So the result of that was a one.</p>



<p>and an end and that was a one so I have two ones basically so this XOR is going to output</p>



<p>a zero because it&#8217;s it&#8217;s got two ones as an input or as inputs okay so then I guess I could copy</p>



<p>paste this to make it a little bit easier on myself to write it all out and I could just say</p>



<p>let&#8217;s not the whole entire thing to get to that highest level so I you know again I can just kind</p>



<p>I, you know, again, I can just kind of keep the whole thing copy pasted and you know,</p>



<p>the original input bit sequence, uh, I can just nod it.</p>



<p>I can just change that zero to a one.</p>



<p>So let&#8217;s just double check all our levels here to make sure that I did this correctly.</p>



<p>You never know.</p>



<p>So the input not, we know what that is for the end and the X or where&#8217;s the end and the</p>



<p>X or, okay.</p>



<p>So bottom left.</p>



<p>What did I do wrong?</p>



<p>Input.</p>



<p>Oh, that was, those were just the basics.</p>



<p>Okay.</p>



<p>So that&#8217;s not a combination.</p>



<p>Okay, so that&#8217;s not a combination.</p>



<p>Let me just double check the basics for the anding.</p>



<p>Zero and zero and zero and then zero and then one and then one.</p>



<p>And then here it should be a one and then the or should be one and should be zero.</p>



<p>And here the and should be one and the or should be one.</p>



<p>Okay, so I&#8217;ve got the basics, right?</p>



<p>And then on line 15 here, we&#8217;re looking at</p>



<p>an AND and an XOR. I guess I just did both of those at the same time. Okay, so the AND is a</p>



<p>1 and the XOR is a 1. And then the next one, the OR and the AND, it&#8217;s a 1 and a 0. Okay.</p>



<p>And then we&#8217;re ANDing the AND and the XOR. So that&#8217;s a 1, 1, 0, 1. The answer should be a 1.</p>



<p>That matches the diagram. Okay. And then the ORing of the OR and the AND on the right side,</p>



<p>the or and the and on the right side, that&#8217;s a one.</p>



<p>So that matches the diagram.</p>



<p>And then when we&#8217;re doing the whole thing, except for the knot,</p>



<p>it should be a zero at the top.</p>



<p>Okay, good.</p>



<p>And then finally, when we invert it at the very top, it&#8217;s a one.</p>



<p>So keep that in mind.</p>



<p>You can build and build and build in a hierarchical manner.</p>



<p>I mean, think if I started adding a bunch more stuff on top of this knot,</p>



<p>maybe if there were a bunch of other circuits somewhere else</p>



<p>and they were combining and combining like many layers.</p>



<p>This is the sort of thing that could help you.</p>



<p>Drawing, I think, is a little bit easier, but this could help you to just draw out a little table.</p>



<p>And of course, you want to have a giant table showing all combinations somewhere,</p>



<p>just to make sure that you can just look it up quickly.</p>



<p>But yeah.</p>



<p>Okay, so I think this is all I wanted to talk about.</p>



<p>Let me just double check.</p>



<p>All right.</p>



<p>So this is all I wanted to talk about for this video,</p>



<p>about logical gates and the basics and kind of helping yourself with a little bit of a table.</p>



<p>yourself with a little bit of a table. In future videos, I&#8217;ll talk about a proper table, perhaps.</p>



<p>And I hope you&#8217;ve learned a little bit and laughed a little bit at me struggling to do this on the</p>



<p>fly without a pre-made example. And I hope you had a little bit of fun and learned a little bit</p>



<p>of stuff. And I&#8217;ll see you in the next video. Thanks for watching. Hey, everybody. Thanks for</p>



<p>watching this video again from the bottom of my heart. I really appreciate it. I do hope you did</p>



<p>If you could do me a please a small little favor</p>



<p>Could you please subscribe and follow this channel or these videos or whatever it is you do on the current social media?</p>



<p>It&#8217;s a website that you&#8217;re looking at right now</p>



<p>It would really mean the world to me and it&#8217;ll help make more videos and grow this community</p>



<p>So we&#8217;ll be able to do more videos longer videos better videos or just i&#8217;ll be able to keep making videos in general</p>



<p>So, please do do me a kindness and and subscribe</p>



<p>I&#8217;m sleeping in the middle of the night and I just wake up because I know somebody subscribed or followed.</p>



<p>It just wakes me up and I get filled with joy.</p>



<p>That&#8217;s exactly what happens every single time.</p>



<p>So you could do it as a nice favor to me or you could troll me if you want to just wake me up in the middle of the night.</p>



<p>Just subscribe and then I&#8217;ll just wake up.</p>



<p>I promise that&#8217;s what will happen.</p>



<p>Also, if you look at the middle of the screen right now, you should see a QR code which you can scan in order to go to the website,</p>



<p>which I think is also named somewhere at the bottom of this video.</p>



<p>and it&#8217;ll take you to my main website where you can just kind of like see all the videos I published and</p>



<p>the services and tutorials and things that I offer and all that good stuff.</p>



<p>And if you have a suggestion for clarifications or errata or just future videos that you want to see,</p>



<p>please leave a comment.</p>



<p>Or if you just want to say, hey, what&#8217;s up? What&#8217;s going on?</p>



<p>You know, just send me a comment, whatever.</p>



<p>I also wake up for those in the middle of the night.</p>



<p>I wake up in a cold sweat and I&#8217;m like,</p>



<p>it would really mean the world to me.</p>



<p>I would really appreciate it.</p>



<p>So again, thank you so much for watching this video</p>



<p>and enjoy the cool music</p>



<p>as I fade into the darkness,</p>



<p>which is coming for us all.</p>



<p>Thank you.</p>
<p>The post <a href="https://www.NeuralLantern.com/logic-gates-crash-course-learn-and-or-xor-not-build-circuits/">Logic Gates Crash Course: Learn AND, OR, XOR, NOT &amp; Build Circuits</a> appeared first on <a href="https://www.NeuralLantern.com">NeuralLantern.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.NeuralLantern.com/logic-gates-crash-course-learn-and-or-xor-not-build-circuits/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Master Bitwise Operators: OR, AND, NOT, XOR, NOR for Beginners</title>
		<link>https://www.NeuralLantern.com/master-bitwise-operators-or-and-not-xor-nor-for-beginners/</link>
					<comments>https://www.NeuralLantern.com/master-bitwise-operators-or-and-not-xor-nor-for-beginners/#respond</comments>
		
		<dc:creator><![CDATA[mike]]></dc:creator>
		<pubDate>Mon, 30 Jun 2025 06:15:25 +0000</pubDate>
				<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[Videos]]></category>
		<category><![CDATA[AND operator]]></category>
		<category><![CDATA[binary logic]]></category>
		<category><![CDATA[binary operations]]></category>
		<category><![CDATA[bit manipulation]]></category>
		<category><![CDATA[bitwise operators]]></category>
		<category><![CDATA[C programming]]></category>
		<category><![CDATA[coding for beginners]]></category>
		<category><![CDATA[coding tips]]></category>
		<category><![CDATA[computer science basics]]></category>
		<category><![CDATA[NOR operator]]></category>
		<category><![CDATA[NOT operator]]></category>
		<category><![CDATA[OR operator]]></category>
		<category><![CDATA[programming tutorial]]></category>
		<category><![CDATA[tech tutorials]]></category>
		<category><![CDATA[XOR operator]]></category>
		<guid isPermaLink="false">https://www.NeuralLantern.com/?p=173</guid>

					<description><![CDATA[<p>Learn bitwise operators (OR, AND, NOT, XOR, NOR) with clear examples. Perfect for beginners mastering binary logic in programming.</p>
<p>The post <a href="https://www.NeuralLantern.com/master-bitwise-operators-or-and-not-xor-nor-for-beginners/">Master Bitwise Operators: OR, AND, NOT, XOR, NOR for Beginners</a> appeared first on <a href="https://www.NeuralLantern.com">NeuralLantern.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<iframe title="Master Bitwise Operators: OR, AND, NOT, XOR, NOR for Beginners" width="1380" height="776" src="https://www.youtube.com/embed/mL_wTRllqtc?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
</div></figure>



<p>Want to understand bitwise operators? This video dives into OR, AND, NOT, XOR, and NOR with easy-to-follow examples. Learn how to use these operators for flags, masks, and more in programming. Perfect for beginners or anyone wanting to master binary logic in C or other languages. I break it down with real examples, a touch of humor, and no fluff. Subscribe for more coding tutorials, and check out my site for extra resources. Drop a comment with your questions or video ideas!</p>



<p>Introduction to Logical Operators 00:00:00<br>Explanation of Bitwise OR 00:00:35<br>OR Operation Examples 00:01:01<br>Bitwise OR with Multiple Bits 00:02:12<br>Using OR for Flags 00:03:52<br>Introduction to Logical AND 00:08:06<br>AND Operation Examples 00:08:29<br>Using AND as a Mask 00:10:00<br>Checking Specific Bits with AND 00:11:17<br>Introduction to NOT Operation 00:13:36<br>Introduction to NOR Operation 00:14:38<br>Introduction to XOR Operation 00:16:37<br>XOR and Neural Networks 00:16:53<br>Conclusion and Call to Action 00:18:38</p>



<p>Thanks for watching!</p>



<p>Find us on other social media here:</p>



<ul class="wp-block-list">
<li>https://www.NeuralLantern.com/social</li>
</ul>



<p>Please help support us!</p>



<ul class="wp-block-list">
<li>Subscribing + Sharing on Social Media</li>



<li>Leaving a comment or suggestion</li>



<li>Subscribing to our Blog</li>



<li>Watching the main &#8220;pinned&#8221; video of this channel for offers and extras</li>
</ul>



<p>Hey everybody! In this video I&#8217;m going to talk about basic logical operators such as OR and AND.</p>



<p>Uh so let&#8217;s let&#8217;s dive right into it. What am I talking about with the OR and AND?</p>



<p>Suppose for the sake of argument that this notepad is totally dark and I wanted it to be really light</p>



<p>and then I have to go into the system settings to fix it. Sorry let me change my theme.</p>



<p>How about that?</p>



<p>Okay.</p>



<p>So suppose for the sake of argument, we&#8217;ve got, you know, a couple of bits.</p>



<p>These are going to be a bitwise operations for the most part.</p>



<p>In other languages, sometimes we will say logical operator, but actually we&#8217;re just</p>



<p>talking about values rather than bits individually.</p>



<p>So these are bitwise operators.</p>



<p>Imagine we have like a couple of bits.</p>



<p>Remember the possible values for bits are just, you know, a zero and a one binary.</p>



<p>So suppose we have a couple of values.</p>



<p>values, let&#8217;s say we have a zero here and a one.</p>



<p>So if I apply a logical or to the zero and the one,</p>



<p>the result is going to be a one because either the first bit or the second bit are a one.</p>



<p>You could also expand these operators to have multiple sets of bits,</p>



<p>but we&#8217;re just going to do, you know, one set against another set.</p>



<p>In this case, each set is just one bit long, but we&#8217;ll do, we&#8217;ll do a more complicated stuff in a minute.</p>



<p>If I have a zero and a one, then the answer there is, well, let me just put or maybe.</p>



<p>The answer is a one.</p>



<p>I&#8217;ll put or maybe at the top, just like or to let you know that we&#8217;re doing ors here</p>



<p>on the top.</p>



<p>So if we have a zero and a one, the answer is going to be a one.</p>



<p>If we have a one and a zero, the answer is going to be a one.</p>



<p>Also, if we have two ones, which looks like an L over there, I got to work on my penmanship.</p>



<p>Then the answer is also going to be a one.</p>



<p>if either of the bits in question are a one then the answer should be a one. The only case with an</p>



<p>OR that results in a zero is if both of the bits are zero because neither the first or the second</p>



<p>are actually a one right so this is the basic idea of using an OR operator and you can also do this</p>



<p>with multiple bits at the same time like for example we could say let&#8217;s take a bunch of random</p>



<p>work on the it&#8217;s the pressure dude the l&#8217;s are driving me crazy okay oh my god okay so i do that</p>



<p>and i let go okay i&#8217;m just going to put some random bits uh underneath the the first set of</p>



<p>random bits put like a zero here and then like a one here maybe and we&#8217;ll say that we&#8217;re going to</p>



<p>do a logical or just like you might think of doing a you know addition or subtraction we&#8217;ll just say</p>



<p>you know, addition or subtraction. We&#8217;ll just say we&#8217;re going to or these two sets of bits.</p>



<p>Actually, these are six on the top and six on the bottom. If I add two more, then it&#8217;ll be a nice</p>



<p>little bite for the top and the bottom. So I&#8217;m just going to do that, you know, to have eight</p>



<p>bits on the top and eight bits on the bottom. Okay. So if I just want to logically or two sets</p>



<p>of bits, literally, I just have to do one pair of bits at a time. So a one or zero is just a one.</p>



<p>One or zero is just a one, a zero or one is a one, a one or zero is a one, a zero or one</p>



<p>is a one.</p>



<p>And then these ones, everything is just a one.</p>



<p>Okay.</p>



<p>So that was too easy.</p>



<p>Maybe if I, I don&#8217;t know, maybe if I change one of these ones to a zero, then we would</p>



<p>actually be able to have a zero somewhere in here.</p>



<p>So that&#8217;s a logical or a bitwise or operator or operation.</p>



<p>So you can, you can kind of use this in various ways.</p>



<p>can kind of use this in various ways i mean obviously if you want to manipulate some bits</p>



<p>this can be pretty useful inside of the machine but there was kind of an old school way that</p>



<p>people did flags with arguments they would basically say something like this they would go</p>



<p>in their computer program they would say you know flag a name it something like turn on the display</p>



<p>or enable caching or just like whatever right so we&#8217;ll just have a flag we&#8217;ll call it flag a</p>



<p>that value is equal to a one and then maybe flag b its value is equal to a two and then flag c</p>



<p>its value would be a four and then we basically just double the value of the flag and the reason</p>



<p>for that c d e f i&#8217;ll just stop with f maybe oh wait that was supposed to be 16 and that&#8217;s 32.</p>



<p>the reason for that is if you double the value of each flag so that uh</p>



<p>and then you can do a bitwise or against all of these flags and sort of combine multiple flags.</p>



<p>Because if you think about it, if we&#8217;re talking about binary,</p>



<p>if we suppose this is just a regular eight bit number, then, you know, the first bit has a</p>



<p>strength of one. If you&#8217;ve seen my other videos for converting between binary and hex,</p>



<p>the second bit has a strength of two. The next bit has a strength of four and then eight and</p>



<p>and then 32 and 64 and then 128.</p>



<p>And so if you look at the flags,</p>



<p>1, 2, 4, 8, 16, 32,</p>



<p>they map to only one bit.</p>



<p>It&#8217;s not going to be some kind of random pattern for these numbers.</p>



<p>It&#8217;s literally going to be flag A is going to look like this.</p>



<p>1, 2, 3, 4, 5, 6, 7, 8.</p>



<p>And then flag B is going to look like this.</p>



<p>1, 2, 3, 4, 5, 6, 7, 8.</p>



<p>five, six, seven, eight. And flag D is going to look like this. Whoops. Let me make that green.</p>



<p>Still getting used to this. Oh, sorry. C is the next one. One, two, three, four, five,</p>



<p>six, seven, eight. Can you see the pattern here? Let me just do D and be done with it at this</p>



<p>point. One, two, three, four, five, six, seven, eight. So because we&#8217;re increasing the value of</p>



<p>the flags by a power of two, or by a power of two, they&#8217;ll always correspond to just one bit.</p>



<p>they&#8217;ll always correspond to just one bit, which means if you apply a logical or operation,</p>



<p>you can represent a bunch of different flags with just one number.</p>



<p>Think about this.</p>



<p>What if I wanted to have, oh, I don&#8217;t know.</p>



<p>Let me erase this.</p>



<p>What if I wanted to have some, let&#8217;s say I wanted flag A and flag D and flag F just for</p>



<p>the sake of argument.</p>



<p>Dang, this pen.</p>



<p>It&#8217;s actually my fault completely, but I need to practice.</p>



<p>but I need to practice F okay and DNF so that would basically be you know 1 2 3 4 5 6 7 8</p>



<p>and then D would be the 8 so a 1 0 0 0 there and then a bunch of zeros elsewhere and then the F</p>



<p>So if we did an OR between all of those, then the OR is just basically 00101001.</p>



<p>And if you convert that from binary to decimal, what is that?</p>



<p>That&#8217;s a 1248 plus 8 plus 1248 and then a 32.</p>



<p>So 41.</p>



<p>just write down the number 41 and if the programmer is smart enough to you know parse all the bits</p>



<p>and everything then they&#8217;ll know that you have flags a and d and f set that&#8217;s not necessarily</p>



<p>something that all the modern programs do anymore it was much more popular in the olden days but i</p>



<p>think some people still kind of do it especially if they&#8217;re programming in c and other languages</p>



<p>where they want speed it&#8217;s pretty fast to look at bits inside of the machine so keep that in mind</p>



<p>Keep that in mind now we know how to do an OR operation and we know one reason that it might be useful and</p>



<p>Yeah, okay. I&#8217;m gonna move on to the next operation</p>



<p>So clearing the screen now</p>



<p>Hello little doggy he barked and now he&#8217;s in the room</p>



<p>Let&#8217;s do</p>



<p>The logical AND operation okay, so suppose we have two bits here</p>



<p>in a one only if both of the input bits are a one i&#8217;m gonna whoops i accidentally cleared the whole</p>



<p>entire thing let me forget where my red pen is okay and okay so if we have a zero and a zero</p>



<p>the result is zero because neither of those are a one if we have a zero and a one the result is</p>



<p>still going to be zero because we need both bits to be a one to result in a one so then that means</p>



<p>would also result in a zero. So you get a bunch of zeros until finally you have an input pattern</p>



<p>that is just two ones. And then finally the result is one. So that&#8217;s a logical and.</p>



<p>Let me do a quick example so we can and a bunch of bits together. I&#8217;m just going to do more</p>



<p>random bit patterns. So there&#8217;s another L there. I&#8217;m cringing. I&#8217;m self-cringing. One, two, three,</p>



<p>okay so then i&#8217;ll do like another one there and like a zero there and a zero maybe a couple of</p>



<p>ones maybe three ones and then a zero and then one i guess and we&#8217;ll just say that we&#8217;re going</p>



<p>to end those together so and oh man i&#8217;m mixing uppercase and lowercase like crazy</p>



<p>so uh to end them together you know that bit position right here that&#8217;s going to be a one</p>



<p>and then we have a zero because they don&#8217;t match they&#8217;re not both one and then we have another zero</p>



<p>a one and then we have a zero and a zero and a zero and a one so this is a logical and you can</p>



<p>use logical ands for a wide variety of things but one thing you can kind of do somewhat easily is to</p>



<p>use one number as a mask against another number for example notice how uh suppose this was the</p>



<p>input number let&#8217;s just say we have the input number up top and maybe you wanted to make sure</p>



<p>because you&#8217;re you&#8217;re checking for those bits individually or maybe you want to just prevent</p>



<p>the input from having certain bits on for some other reason well you can you can apply the mask</p>



<p>as the second bit and use a logical and i&#8217;ll say mask here sorry you can apply a mask as the second</p>



<p>bit pattern and notice how in the answer there are only ones where both you know the input and</p>



<p>means if I wanted to just control only which ones are allowed I can use the mask notice how the mask</p>



<p>has ones in these positions and there are definitely no zeros sorry there are definitely</p>



<p>no ones in any position where a mask had a zero so the mask can kind of like you know mute or mask</p>



<p>or control the input pattern if that makes sense hopefully another thing we could do if we wanted</p>



<p>if one bit exists. Let me go ahead and clear this real fast. I&#8217;m going to just do maybe four</p>



<p>bits this time. So we could obviously do an and against four zeros, and this would result in just,</p>



<p>you know, a resulting pattern of zero. So this is not super useful. The result would just</p>



<p>definitely be four zeros. But notice again how the second pattern is sort of controlling what&#8217;s</p>



<p>allowed to go through from the first pattern. Suppose I wanted to check to see if that particular</p>



<p>particular bit was on or off.</p>



<p>All I have to do is mask it with a one in the correct pattern.</p>



<p>So, you know, the second bit that I just wrote down on the bottom row,</p>



<p>I just want to see if that second bit is on or off in the input pattern.</p>



<p>I don&#8217;t care about any of the other bits.</p>



<p>That means the result will be this.</p>



<p>So now it&#8217;s much more easy for me to see if that bit is on.</p>



<p>I could just compare the value of those bits to a regular integer.</p>



<p>Like, for example, if we consider that this was the one and this was the two</p>



<p>considered that this was the one and this was the two and this was the four or sorry four and then</p>



<p>the eight I could just ask now if the final value equals two and then I would know if that bit was</p>



<p>on or not in the original pattern and so if I wanted to check to see if this other you know</p>



<p>bit was on I can move this over here and set that back to a zero so the resulting pattern would be</p>



<p>zeros then I&#8217;d ask myself is the resulting value equal to four no it&#8217;s equal to zero and so then</p>



<p>Another thing you can do that I&#8217;m going to talk about in a future video is just sort of shift the bits over.</p>



<p>You could, instead of checking to see if the value was a 4 or like a direct integer,</p>



<p>you could just sort of shift over a certain number of spots and then check to see if it was equal to 1 or 0.</p>



<p>Let me put this 1 back over into its original position just so that we&#8217;ll have something that had a 1.</p>



<p>is one from uh you know the right side if it&#8217;s one to the left from the right side</p>



<p>then i could just shift all the bits one to the right and end up with a pattern that is zero zero</p>



<p>zero one i&#8217;m not going to talk about bit shifting operations in this video but just know that you can</p>



<p>and you&#8217;ll see more of it in a future video so then you know this is another way to check to</p>



<p>see if a bit was on first you do a mask for that bit and then you shift bits and then you just</p>



<p>check to see if the final value is a zero or one which may or may not feel easier than checking for</p>



<p>or may not feel easier than checking for an actual integer in your program.</p>



<p>Okay, so we&#8217;ve done OR and also AND. The next bit pattern is called a NOT, which is really easy.</p>



<p>It&#8217;s literally just an inversion of the original bit pattern. So for the NOT, we don&#8217;t really take</p>



<p>two bits against each other. We just take an input bit and we just invert it. We&#8217;ll just say</p>



<p>So that&#8217;s a knot. Pretty easy. We could also knot, you know, a random bit pattern with Ls.</p>



<p>So I swear, somebody&#8217;s going to show up and this is their first computer science video.</p>



<p>They&#8217;re going to go tell their parents, hey, there&#8217;s Ls in computer science.</p>



<p>So sorry. I&#8217;m so sorry. Okay. So I got four there. So if I knot those, then that&#8217;s pretty easy.</p>



<p>It&#8217;s just going to be the opposite, you know, an inversion.</p>



<p>you know, an inversion.</p>



<p>One, zero, one, zero.</p>



<p>Let me just double check that I did that correctly.</p>



<p>Yeah, so that&#8217;s the knot pattern.</p>



<p>No big deal.</p>



<p>Pretty easy.</p>



<p>So then maybe the next thing that we can talk about is the nor,</p>



<p>which just means not or.</p>



<p>So let me draw that out real fast just to show you what I&#8217;m talking about.</p>



<p>So if we do nor, pretty much you can imagine first taking the or and then knotting it.</p>



<p>So inverting the or.</p>



<p>the OR. So for example, if we have two bits here, actually, let me, let me do, let me do a</p>



<p>sequential counter. Cause I think that&#8217;s more fun. I&#8217;m counting right now from one to a three</p>



<p>or a actually, I do that in the last one. I started with zero. I hope let&#8217;s count from zero</p>



<p>to three. So zero and then one and then two and then three. So I&#8217;m counting in binary.</p>



<p>two input bits and we&#8217;re going to do a nor then the first thing we probably want to do is take</p>



<p>the or operator so that would be a zero here i&#8217;ll just put or in parentheses just to let you know</p>



<p>that this is kind of a nice first step you could memorize nor if you wanted to but i don&#8217;t i don&#8217;t</p>



<p>really remember how to do it without doing these steps so uh it&#8217;s going to be ones for everything</p>



<p>else because in the or you get a one if either of those is a one and then uh the next step is you</p>



<p>the or i&#8217;ll just put nor here just to let you well just to let you know that you&#8217;re uh well i</p>



<p>don&#8217;t know if i put nor then it kind of sounds like i&#8217;m norring that one bit doesn&#8217;t it so maybe</p>



<p>here i&#8217;ll say uh not just to let you know that this is just one step against the previous bit</p>



<p>so the knot is uh just going to be an inversion and so the nor of zero zero is one the nor of zero</p>



<p>nor of 1 1 is 0 and that&#8217;s how you do a nor and all of these logical or bitwise</p>



<p>operators can be used in circuits and circuit design and just you know other</p>



<p>types of logical operations I&#8217;m gonna move on let&#8217;s see the next one is gonna</p>



<p>be XOR that I wanted to talk about in this video so what is XOR it just means</p>



<p>exclusive or so it&#8217;s a little bit more complicated than or this is actually a</p>



<p>one because it has a history with neural networks. When you have a neural network that does not have</p>



<p>more than one, or sorry, if you have a neural network that does not have any hidden layers,</p>



<p>like if you just have an input layer and an output layer, then the neural network should</p>



<p>actually not be able to solve XOR. It should not be able to learn it. You have to increase the</p>



<p>topology of the neural network in some way, make it a little bit more complicated. For example,</p>



<p>one or more middle layers between the input and the output layers. If you understand neural</p>



<p>networks, it&#8217;s just kind of fun to know, oh, XOR stumps a shallow network and kind of starts to</p>



<p>prove that deep networks might be a little bit smarter or deepish at least. Okay. So XOR,</p>



<p>let&#8217;s start off by counting here. I&#8217;m going to do zero and zero, and then this is the number one,</p>



<p>and this is the number two, and this is the number three. And exclusive OR just basically means</p>



<p>just basically means an or but if both of the bits are one then it&#8217;s a zero so that means</p>



<p>either of the bits can be a one to produce a one but it must be exclusive the bit that is a one</p>



<p>can&#8217;t also be next to another bit that&#8217;s a one so let me show you so in is in a double zero</p>



<p>the answer is just going to be a zero in a zero and one the answer is going to be a one in a one</p>



<p>exclusive, the one is it has a, it has a buddy or a partner.</p>



<p>It&#8217;s not an exclusive one.</p>



<p>So we&#8217;ll say that that&#8217;s a zero.</p>



<p>So that&#8217;s the XOR.</p>



<p>I don&#8217;t know.</p>



<p>You could put like a, a, a not on top of that or an and on top of that or whatever</p>



<p>you wanted to do.</p>



<p>And we can make stuff that&#8217;s a lot more complicated, but these are the basics of</p>



<p>or and not XOR and NOR as bitwise operators.</p>



<p>So thank you for watching this video.</p>



<p>That&#8217;s all I have to say for now.</p>



<p>See you in the next one.</p>



<p>Hope you learned a little bit and had a little bit of fun.</p>



<p>I&#8217;m out.</p>



<p>social media website that you&#8217;re looking at right now it would really mean the world to me and it&#8217;ll</p>



<p>help make more videos and grow this community so we&#8217;ll be able to do more videos longer videos</p>



<p>better videos or just i&#8217;ll be able to keep making videos in general so please do do me a kindness</p>



<p>and uh and subscribe you know sometimes i&#8217;m sleeping in the middle of the night and i just</p>



<p>wake up because i know somebody subscribed or followed it just wakes me up and i get filled</p>



<p>with joy that&#8217;s exactly what happens every single time so you could do it as a nice favor to me or</p>



<p>it as a nice favor to me or you could you could troll me if you want to just wake me up in the</p>



<p>middle of the night just subscribe and then i&#8217;ll i&#8217;ll just wake up i promise that&#8217;s what will</p>



<p>happen also uh if you look at the middle of the screen right now you should see a qr code which</p>



<p>you can scan in order to go to the website which i think is also named somewhere at the bottom of</p>



<p>this video and it&#8217;ll take you to my main website where you can just kind of like see all the videos</p>



<p>i published and the services and tutorials and things that i offer and all that good stuff and</p>



<p>if you have a suggestion for uh uh clarifications or errata or just future videos that you want to</p>



<p>see please leave a comment or if you just want to say hey what&#8217;s up what&#8217;s going on you know</p>



<p>just send me a comment whatever i also wake up for those in the middle of the night i get i wake up</p>



<p>in a cold sweat and i&#8217;m like it would really it really mean the world to me i would really</p>



<p>appreciate it so again thank you so much for watching this video and um enjoy the cool music</p>



<p>the cool music as I fade into the darkness which is coming for us all.</p>



<p>Thank you.</p>
<p>The post <a href="https://www.NeuralLantern.com/master-bitwise-operators-or-and-not-xor-nor-for-beginners/">Master Bitwise Operators: OR, AND, NOT, XOR, NOR for Beginners</a> appeared first on <a href="https://www.NeuralLantern.com">NeuralLantern.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.NeuralLantern.com/master-bitwise-operators-or-and-not-xor-nor-for-beginners/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Master Two&#8217;s Complement: Convert &#038; Subtract Negative Binary Numbers</title>
		<link>https://www.NeuralLantern.com/master-twos-complement-convert-subtract-negative-binary-numbers/</link>
					<comments>https://www.NeuralLantern.com/master-twos-complement-convert-subtract-negative-binary-numbers/#respond</comments>
		
		<dc:creator><![CDATA[mike]]></dc:creator>
		<pubDate>Sun, 18 May 2025 22:53:54 +0000</pubDate>
				<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[Conversions]]></category>
		<category><![CDATA[Videos]]></category>
		<category><![CDATA[binary conversion]]></category>
		<category><![CDATA[binary math]]></category>
		<category><![CDATA[binary numbers]]></category>
		<category><![CDATA[binary subtraction]]></category>
		<category><![CDATA[coding for beginners]]></category>
		<category><![CDATA[computer science basics]]></category>
		<category><![CDATA[negative numbers binary]]></category>
		<category><![CDATA[programming tutorials]]></category>
		<category><![CDATA[signed integers]]></category>
		<category><![CDATA[two's complement]]></category>
		<guid isPermaLink="false">https://www.NeuralLantern.com/?p=110</guid>

					<description><![CDATA[<p>Learn two's complement to represent negative binary numbers with easy examples. Master sign bits &#038; subtraction. Subscribe!</p>
<p>The post <a href="https://www.NeuralLantern.com/master-twos-complement-convert-subtract-negative-binary-numbers/">Master Two&#8217;s Complement: Convert &amp; Subtract Negative Binary Numbers</a> appeared first on <a href="https://www.NeuralLantern.com">NeuralLantern.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<iframe loading="lazy" title="Master Two&#039;s Complement: Convert &amp; Subtract Negative Binary Numbers" width="1380" height="776" src="https://www.youtube.com/embed/i2tfzMqlewQ?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
</div></figure>



<p>Want to conquer negative numbers in binary? This fun, beginner-friendly tutorial breaks down two&#8217;s complement with step-by-step examples (-109, -29) and shows how to convert, pad, and subtract in binary. Learn sign bits, carry bits, and avoid common mistakes. Subscribe for more coding tips and tech tutorials that make learning a blast! Scan the QR code for more resources and join our community!</p>



<p>Introduction to Two&#8217;s Complement 00:00:00<br>Signed vs. Unsigned Integers 00:00:28<br>Sign Bit Explanation 00:01:55<br>Positive and Negative Representation 00:02:06<br>Range of Signed Integers 00:02:48<br>Padding Signed Integers 00:05:36<br>Converting to Negative (Example: -109) 00:07:00<br>Binary Addition and Carry Bits 00:10:16<br>Correcting Conversion Mistakes 00:16:38<br>Converting Negative 29 00:13:32<br>Subtraction Using Two&#8217;s Complement 00:18:21<br>Adding Binary Numbers (109 &#8211; 29) 00:20:41<br>Verifying Results 00:23:56<br>Conclusion and Call to Action 00:25:40</p>



<p>Thanks for watching!</p>



<p>Find us on other social media here:</p>



<ul class="wp-block-list">
<li>https://www.NeuralLantern.com/social</li>
</ul>



<p>Please help support us!</p>



<ul class="wp-block-list">
<li>Subscribing + Sharing on Social Media</li>



<li>Leaving a comment or suggestion</li>



<li>Subscribing to our Blog</li>



<li>Watching the main &#8220;pinned&#8221; video of this channel for offers and extras</li>
</ul>



<p>Hey there! Let&#8217;s talk about representing negative numbers in binary.</p>



<p>We&#8217;re going to use a system called 2&#8217;s complement which is going to allow us to represent signed integers,</p>



<p>which means there will be a positive sign or a negative sign on the integer</p>



<p>and we&#8217;ll still be able to do it in pure binary.</p>



<p>So let me talk a little bit about what I mean first here.</p>



<p>signed and unsigned okay so if i just type the number 14 by itself that is uh that&#8217;s an unsigned</p>



<p>integer we don&#8217;t really know if it&#8217;s positive or negative like do we know that it&#8217;s negative 14 or</p>



<p>do we know that it&#8217;s positive 14 right so the sign is what lets us know if something is positive or</p>



<p>negative okay so if i if i type a number in binary let&#8217;s just do a pure binary number one two three</p>



<p>if you know how to convert binary to decimal you probably recognize right away that this is just</p>



<p>the number zero even if we add a couple of bits here that&#8217;s just like the number three</p>



<p>and so this is the number three but so far if if you haven&#8217;t learned signed integers in twos</p>



<p>complement or in binary then you don&#8217;t really know that there&#8217;s a sign you just kind of assume</p>



<p>that the number is positive by default if you&#8217;re not using twos complement and you&#8217;re just saying</p>



<p>and you&#8217;re just saying like well let&#8217;s just do a bunch of binary you know digits then yeah it&#8217;s a</p>



<p>safe assumption that the the sign is positive but we&#8217;ll use two&#8217;s complement which starts with the</p>



<p>idea that the highest bit the leftmost bit the bit with the height you know the most power that&#8217;s</p>



<p>going to turn into the sign that&#8217;s that&#8217;s going to turn into the plus or the minus so like you</p>



<p>the sign.</p>



<p>So this means that we have to decide, you know, does a zero mean positive or does it</p>



<p>mean negative or what means what?</p>



<p>So in two&#8217;s complement, we&#8217;ll say that zero is positive and one is negative.</p>



<p>So you can see right here that we&#8217;re still actually representing the number three, but</p>



<p>it&#8217;s positive three for sure because this sign bit right here is zero.</p>



<p>That&#8217;s positive.</p>



<p>Once we decide to represent two&#8217;s complement, then we can say that for sure.</p>



<p>On the other hand, if we put a one here,</p>



<p>then we definitely know that this number is now negative.</p>



<p>However, we don&#8217;t actually know that it&#8217;s a three</p>



<p>because the numbers don&#8217;t work out the same anymore</p>



<p>in two&#8217;s complement.</p>



<p>So the positive numbers, they will mostly look the same.</p>



<p>The negative numbers, they&#8217;ll look a lot different,</p>



<p>but they&#8217;ll still be valid in order,</p>



<p>you know, in terms of us being able to add them together,</p>



<p>subtract them from each other and things like that.</p>



<p>So two&#8217;s complement is pretty cool.</p>



<p>Let&#8217;s do, let&#8217;s see, what else can I tell you?</p>



<p>Oh, one thing to understand is that</p>



<p>One thing to understand is that in an 8-bit unsigned integer in binary, let&#8217;s say 1, 2,</p>



<p>3, 4, 5, 6, 7, 8, let&#8217;s say unsigned bits, maybe I&#8217;ll just put like, maybe just some</p>



<p>like V for value, all the bits are values, that means the range is 0 to 255 with 256</p>



<p>total combinations.</p>



<p>But if we want to use a signed number, then we&#8217;ll actually have the signed bit be the first bit,</p>



<p>and all the rest will be value bits.</p>



<p>1, 2, 3, 4, 5, 6, 7.</p>



<p>In this case, the range kind of goes down.</p>



<p>Because if you think about it, every single bit, you know, represents like, you know,</p>



<p>it helps towards the highest possible value that you can represent.</p>



<p>If we&#8217;re using the leftmost bit, then for an 8-bit integer, that&#8217;s 128.</p>



<p>integer that&#8217;s 128 that&#8217;s a value of 128 so we lose a lot off of the maximum</p>



<p>integer that we can represent so the range here is I think it&#8217;s negative 20</p>



<p>128 to positive 127 just keep in mind you&#8217;ll have to trust me in terms of why</p>



<p>is the negative 128 bigger and the positive 127 you know smaller but that&#8217;s</p>



<p>just the way it is so that means we only get these value bits here and if you if</p>



<p>that um let&#8217;s see if i can do this quickly enough without screwing it up we&#8217;ll say 127 minus um</p>



<p>minus negative 128 i guess that&#8217;s 255 and then also a zero but uh in terms of positive and</p>



<p>negative the way this is going to work out is the zero will probably show up twice because uh</p>



<p>255 possible combinations with seven bits.</p>



<p>Normally you would have a range from negative, sorry, from zero to positive 255.</p>



<p>And in this case, we&#8217;re just, you know, losing our range, but we can represent negative numbers.</p>



<p>Anyway. Okay.</p>



<p>So let&#8217;s talk about doing an example real fast. Let&#8217;s see.</p>



<p>I&#8217;ve got like a little notes to tell me what I should do. Okay.</p>



<p>It&#8217;s important to understand that normally when you have, let&#8217;s say, let&#8217;s say you have</p>



<p>like an 8-bit number and you go 1, 2, 3, 4, 5, 6, 7, 8.</p>



<p>And then you have 2 bits right there and so this is like, you know, positive 3.</p>



<p>If you wanted to copy that number into more bytes, like for example, if you wanted to</p>



<p>take a 2-byte integer and have it copy the value of a 1-byte integer, then it&#8217;s pretty</p>



<p>easy.</p>



<p>zeros to the left you&#8217;ll say one two three four five six seven eight that would work perfectly</p>



<p>however if you did this with a negative number let&#8217;s say that we have a negative number</p>



<p>I&#8217;m going to put some of the random patterns so that you don&#8217;t think it&#8217;s the three let&#8217;s see</p>



<p>one two three four five six seven eight that&#8217;s eight total so I&#8217;m going to make that a one and</p>



<p>then get rid of that so we have like eight negative number if we were going to copy that</p>



<p>integer then we would copy paste it to start but then you&#8217;d have to pad with</p>



<p>ones to the left one two three four five six seven eight same negative number</p>



<p>more bits so be very careful about how you pad if you&#8217;re padding an unsigned</p>



<p>integer then yeah you&#8217;ll always pad zeros to the left no matter what is</p>



<p>happening but if you&#8217;re padding a signed integer then you have to pad differently</p>



<p>signed integer you have to pad with whatever the highest bit is so in this case the highest bit was</p>



<p>a zero so we do pad with zeros but then in this case the highest bit was a one so we have to pad</p>



<p>with ones if you don&#8217;t do that you&#8217;re going to end up with a number that doesn&#8217;t actually make</p>



<p>sense okay so now let&#8217;s work on actually converting a number to a negative number or representing a</p>



<p>negative number in twos compliment okay so i&#8217;m going to write twos compliment here and then uh</p>



<p>Let&#8217;s start off with the number negative 109.</p>



<p>Okay, how do we do this?</p>



<p>The first thing is convert it to its positive form.</p>



<p>Take the absolute value. Okay.</p>



<p>So we&#8217;re really just, you know, take positive form here,</p>



<p>and that&#8217;s just going to be positive 109.</p>



<p>Okay, no problem.</p>



<p>I&#8217;ll say start with negative 109, and then we&#8217;ll take the positive form 109.</p>



<p>Now we&#8217;ll convert it to binary.</p>



<p>Okay, this is not a video that teaches you how to convert to binary, so I&#8217;m just going</p>



<p>to try to do this in my head real fast here.</p>



<p>It&#8217;s going to be, let&#8217;s see, we got 8 bits, we&#8217;ll use just 8 bits to store the number,</p>



<p>and because it&#8217;s low enough and I don&#8217;t want to use that many bits, so it&#8217;s odd, so I can</p>



<p>add a 1 there, but maybe for now I should find the highest bit that is less than the</p>



<p>actual number.</p>



<p>So this is the 128 bit right here. So that&#8217;s going to be a zero. This is the 64 bits</p>



<p>I&#8217;m going to put a one there and I&#8217;m just going to say</p>



<p>Mmm, maybe like</p>



<p>This is like maybe not the smartest way to do it. I&#8217;ll say 109 minus 64</p>



<p>Because I put a one there and then 45 so now this is 32 that&#8217;s less than 45. So I&#8217;ll put a one there and</p>



<p>Then it&#8217;s going to be minus 40</p>



<p>So it goes from 45 to 13.</p>



<p>So then that was the 32.</p>



<p>Okay, so 128, 64, 32, and then 16.</p>



<p>Is 16 less than 13?</p>



<p>No, it&#8217;s not.</p>



<p>So we&#8217;ll put a zero here.</p>



<p>And then the next one is going to be just four.</p>



<p>Four is definitely less.</p>



<p>So I&#8217;ll put a one bit there.</p>



<p>And then I&#8217;ll subtract four.</p>



<p>And then one, two, four.</p>



<p>Oh, wait a minute.</p>



<p>One, two, four, eight.</p>



<p>wait a minute one two four eight sorry that was supposed to be subtracted uh subtracting eight</p>



<p>because that was the eight bit uh then i want to get five so here is the four bit so i put a one</p>



<p>there and then i&#8217;ll just put a one here because four plus five is equal to uh i&#8217;m sorry four plus</p>



<p>one is equal to five so let&#8217;s see um it is let me just double check here one</p>



<p>one let me just double check my conversion real fast it&#8217;s going to be</p>



<p>the one bit plus two four plus eight six thirty two plus thirty two plus sixty</p>



<p>four did I get one on nine yeah okay so I guess I did it right so convert to</p>



<p>binary and that&#8217;s going to be this the next thing we&#8217;ll do is we will invert the</p>



<p>bits I made a little edit jump here because I inverted the bits incorrectly</p>



<p>on the first try which is sad but hey it happens the next thing we&#8217;ll do is</p>



<p>but hey it happens the next thing we&#8217;ll do is we&#8217;ll invert the bits so basically you know we</p>



<p>take this original sequence here and i&#8217;ll just turn every single bit uh i&#8217;ll flip it i&#8217;ll flip</p>



<p>ones to zeros and zeros to ones so i&#8217;m going to go one zero zero one zero zero one zero okay so now</p>



<p>we have this number invert the bits then we just have to add one so we&#8217;ll add positive one to that</p>



<p>that it&#8217;s just going to be a one there at the end.</p>



<p>But sometimes that might not be the case</p>



<p>because what if we already had a one there</p>



<p>and we had to add one to that?</p>



<p>Well, we&#8217;d add one to the right side</p>



<p>and it would turn into a zero</p>



<p>and then it would carry a bit to the left.</p>



<p>That would become a zero</p>



<p>and then the carry bit would show up all the way over there.</p>



<p>So I just want you to be aware of the fact that</p>



<p>when you add two binary numbers together,</p>



<p>you have to be careful.</p>



<p>You have to add them the same way you would add decimal numbers.</p>



<p>For each digit&#8217;s position,</p>



<p>you have to add the two numbers together and then if they overflow then you just</p>



<p>kind of wrap around to the lowest number again subtracting you know the highest</p>



<p>value or sorry subtracting the base like in decimal if you add 9 and 9 the answer</p>



<p>is 18 but you&#8217;re not going to write 18 in that one position you&#8217;re going to</p>



<p>subtract the base which is 10 so it&#8217;ll actually be 8 and then you&#8217;ll carry the</p>



<p>plus nine is equal to eight carry the one right so we&#8217;ll do the same thing in binary we&#8217;ll say</p>



<p>if we ever get a one plus one when we&#8217;re adding the answer will be two but then we subtract the</p>



<p>base which is two so the answer is actually zero carry a one bit keep that in mind i&#8217;m just gonna</p>



<p>write it all out for you so you can kind of get a little bit of practice it&#8217;s important to to</p>



<p>practice this because it&#8217;s easy to get wrong i&#8217;m going to put a bunch of dashes up at the top to</p>



<p>and I&#8217;m going to say we&#8217;re going to add, you know, one number plus another number,</p>



<p>put a little plus symbol over there just to try and make sure we do it the right way.</p>



<p>Okay, so how do we add these?</p>



<p>Well, we&#8217;ll just go to the right side.</p>



<p>Zero plus one is one, no carry bit.</p>



<p>One plus zero is one, no carry bit.</p>



<p>Then we got a couple zeros here, no carry bit, of course.</p>



<p>One plus zero is one, no carry bit.</p>



<p>And then a couple zeros and then another one with no carry bit.</p>



<p>Okay, so, you know, we could have done that pretty easily, but</p>



<p>but well now we&#8217;re getting a taste for binary addition that might be harder later.</p>



<p>So we&#8217;ll just do that for now.</p>



<p>And now this is the two&#8217;s complement representation of negative 109.</p>



<p>I&#8217;ll say now we have negative 109 is equal to that.</p>



<p>leftmost number the most powerful sorry leftmost bit the most powerful bit is a one remember one</p>



<p>always indicates negative so when you&#8217;re looking at it if your leftmost bit turns out to be a zero</p>



<p>then you probably did something wrong or you had an overflow maybe um and again if we were going</p>



<p>to try to you know send this number into a two byte number or an eight byte number or whatever</p>



<p>uh then we would just have to pad with the sign bit so one two three four five six seven eight</p>



<p>help my brain so this was this is the way it would look in a two-byte number this is the way it would</p>



<p>look in a three-byte a four-byte and five six seven how many one two three four five six seven</p>



<p>okay one more this is what it would look like as an eight-byte number or a quad word 64-bit number</p>



<p>yeah okay so now we know how to do negative 109 okay so now let&#8217;s do a number that&#8217;s a little bit</p>



<p>negative 29. So let&#8217;s say convert, or how about represent negative 29 into</p>



<p>2&#8217;s complement. Okay. So first we, you know, first get the absolute value.</p>



<p>So just 29. And then we have to invert the, sorry, we have to get that into binary. So</p>



<p>next convert to binary. And I&#8217;m going to start with zeros, one, two, three, four, five, six,</p>



<p>1, 2, 3, 4, 5, 6, 7, 8.</p>



<p>For this video, remember, we&#8217;re choosing to use one byte integers.</p>



<p>But if you wanted to do a bigger one or you had to do a bigger one,</p>



<p>then just, you know, keep that in mind.</p>



<p>Okay, so 128 is not smaller than 29.</p>



<p>64 is not.</p>



<p>32 is not.</p>



<p>16 is, though.</p>



<p>So I&#8217;ll put a 16 bit there.</p>



<p>And I&#8217;ll just subtract 16 from 29.</p>



<p>29 minus 16.</p>



<p>Now we&#8217;ve got 13 left.</p>



<p>So 64, 32, 16.</p>



<p>six four thirty two sixteen eight okay so now I&#8217;m gonna put a one bit there and</p>



<p>I&#8217;m gonna subtract 8 from the remainder and then we got a five which is pretty</p>



<p>easy to do eight four and then a one so now we have well zero zero zero one one</p>



<p>one zero one that&#8217;s the binary number the positive or unsigned representation</p>



<p>representation. So now we&#8217;ll add one. Positive one. And let&#8217;s try to do this the right way so</p>



<p>that we can practice carry bits with addition a little bit. Notice how this one is already there</p>



<p>on the right side. So it&#8217;s going to, we&#8217;re going to have at least one carry bit for sure.</p>



<p>So then I&#8217;m going to go doop like that. And then I&#8217;m going to say that we have like, you know,</p>



<p>what is the result? Put a positive sign there. And then I&#8217;m going to put a bunch of dashes</p>



<p>my carry bits because I can I can forget that pretty easily. So the first thing is we add one</p>



<p>and one. The answer is two, but we can&#8217;t put the number two here because it&#8217;s binary. Instead we</p>



<p>need to subtract the base which is two. So two minus two is equal to zero, but then we have a</p>



<p>carry bit of one. So I&#8217;m going to put a one there. The first carry bit will stay as a dash for this</p>



<p>whole you know exercise because you&#8217;re not going to carry on to the first digit. So now we have</p>



<p>what would have been just zero plus zero now we have one plus zero plus zero so</p>



<p>that means this is going to be one and then the carry bit is just going to be</p>



<p>zero because we don&#8217;t actually carry anything so then we have zero plus one</p>



<p>plus zero so that&#8217;s going to be a one and then zero carry bit and then zero</p>



<p>one zero is just going to be one and then there&#8217;s going to be no carry bit</p>



<p>and then zero one zero again a one no carry bit because we didn&#8217;t actually</p>



<p>zero zero zero and then I&#8217;m just gonna put zeros here okay so now we have</p>



<p>successfully added I blew it totally blew it I always forget steps don&#8217;t</p>



<p>forget the steps this is a good lesson I&#8217;m gonna leave this in the video</p>



<p>because I want you to see that everybody makes mistakes and you got to practice</p>



<p>practice practice especially before you have to actually do this in real life or</p>



<p>or something like that.</p>



<p>Next, convert to binary.</p>



<p>Before you add one, I&#8217;m gonna just remove this.</p>



<p>Oh my gosh.</p>



<p>Next, flip the bits,</p>



<p>which is gonna be 1110010.</p>



<p>Okay.</p>



<p>So now we take this bit flipped number</p>



<p>and we will add one.</p>



<p>So that&#8217;s gonna be zero, zero, zero, zero, zero, zero, zero,</p>



<p>one, oh, it&#8217;s too easy.</p>



<p>Maybe I got excited and I thought,</p>



<p>excited and I thought, oh, it&#8217;s carry bit time.</p>



<p>But even though the last edition that I did was wrong because I forgot to carry</p>



<p>the or flip the bits, you still at least saw a little bit about how to carry the bits.</p>



<p>Right. OK, so it&#8217;s just going to be one.</p>



<p>Let me start from the right side.</p>



<p>One one zero zero zero one one one one one one.</p>



<p>Let me just double check here.</p>



<p>One one one zero zero zero.</p>



<p>OK, so I got that.</p>



<p>Now we have.</p>



<p>negative 29 in twos compliment. Again notice if we actually tried to add those numbers up to be</p>



<p>like an unsigned binary number they&#8217;re not really going to make sense because this is like 64 plus</p>



<p>32 plus 3. So what would that end up being? Let&#8217;s just double check here. 64 plus 32 plus 3, 99.</p>



<p>That&#8217;s not actually the number but the number is 29. So keep in mind you can&#8217;t just look at this</p>



<p>unless you&#8217;re like really, really practiced.</p>



<p>Okay, and again, notice that the number is 1 at the very left,</p>



<p>indicating that it&#8217;s a negative number.</p>



<p>Now, let&#8217;s look at how to subtract one number from another</p>



<p>using 2&#8217;s complement.</p>



<p>Okay, so what I want to do is I want to subtract,</p>



<p>let&#8217;s say, 29 from 109.</p>



<p>Okay, so let&#8217;s subtract, and I&#8217;ll just say 109 minus 29.</p>



<p>109 minus 29.</p>



<p>And how I would do that is basically I&#8217;ll start by just taking 109.</p>



<p>Let&#8217;s see, convert to binary.</p>



<p>So I&#8217;m just going to copy paste that number.</p>



<p>So 109 is this and then 29, take the positive version.</p>



<p>It is just, let&#8217;s see, before we flip the bits or anything,</p>



<p>let me make sure that I grab the right one.</p>



<p>Invert the bits, okay.</p>



<p>So positive 29 is this number.</p>



<p>Whoops.</p>



<p>is this number whoops let me put parentheses around that so it&#8217;s easy to tell and then I&#8217;ll</p>



<p>put a positive sign there like that maybe like that nope nope nope nope how about this okay</p>



<p>so now we have both of these numbers in positive form so now if we added 109 plus 29 that wouldn&#8217;t</p>



<p>negative positive 29 that would be what we wanted right because really if you&#8217;re subtracting</p>



<p>i&#8217;ll say aka</p>



<p>positive 29 plus negative 29 all we really need to do is um invert the 29 and then add the result</p>



<p>to 109 so that means we&#8217;ll we&#8217;ll turn positive 29 into negative 29 using two&#8217;s complement</p>



<p>through the steps again but basically put it there but basically you know that&#8217;s negative 29</p>



<p>so say positive 129 is equal to what i just put up here and then negative 29 is equal to</p>



<p>maybe i should do the parentheses again for clarity uh is equal to this okay so you can tell</p>



<p>that positive 29 is pretty pretty different from negative 29 but now we have</p>



<p>29 but now we have both of those numbers so let&#8217;s see 0 1 1 0 and then we&#8217;re ready to add okay all</p>



<p>we got to do is add them together next add them together maybe I should write the steps up here</p>



<p>negative 29 using twos complement and then next add them together so then I&#8217;m</p>



<p>going to copy paste the bits here and it&#8217;s going to be this plus this do a</p>



<p>positive plus sign just to remind ourselves that we are actually adding</p>



<p>and then I&#8217;m going to put a bunch of placeholders for sign bits up at the</p>



<p>top and now we&#8217;ll have a little bit more fun adding numbers together maybe I&#8217;ll</p>



<p>drag this down</p>



<p>Oh my god. Oh, there we go. Okay. So I&#8217;ll start with the one on the right, the position on the</p>



<p>right. That&#8217;s going to be one plus one equals two, but then that&#8217;s an overflow. So I&#8217;m going to</p>



<p>subtract the base. So it&#8217;s going to be zero. And then don&#8217;t forget to carry the one. Oh,</p>



<p>cool. More interesting. So we have one plus zero plus one. That&#8217;s going to be another two carry</p>



<p>two carry the one so it&#8217;s going to be zero and then carry the one again so i&#8217;m going to put the</p>



<p>carry bit up there and then again we have one plus one is equal to two so it&#8217;s going to be zero</p>



<p>carry the one again zero carry the one and then finally we don&#8217;t really have a carry bit</p>



<p>um so we&#8217;ll just have like a one and there&#8217;s there&#8217;s no carry so it&#8217;s going to be you know</p>



<p>carry a zero and then we add these two together so it&#8217;s going to be a zero carry the one and then</p>



<p>Now we have a three.</p>



<p>Oh, that&#8217;s kind of nice.</p>



<p>So this is an interesting edge case kind of.</p>



<p>One plus one plus one is three.</p>



<p>But if we subtract two, the base from it, you know, three minus two, it&#8217;s going to be one, not zero.</p>



<p>So it actually is going to be a one and then carry the one on top of that.</p>



<p>Then for here, let me space this over a little bit so that I can illustrate what&#8217;s going on a little bit better.</p>



<p>We&#8217;re going to have one plus zero plus one.</p>



<p>definitely going to be zero and then carry the one but there&#8217;s no bit where that carried one can</p>



<p>can show up on right so that one overflows it falls off the edge if this was a bigger number</p>



<p>then okay we you know if we had more bits to this number then sure we would just keep carrying over</p>



<p>over to the left but remember we said before that when we have a very big number let&#8217;s see</p>



<p>bits it&#8217;s just ones all the way to the side that will actually help us make sure that if our final</p>



<p>number is actually going to end up being positive that everything kind of like dominoes like carry</p>



<p>the one carry the one carry the one carry the one carry the one all the way until one of the ones</p>



<p>falls off think about it so anyway this one just is gone we don&#8217;t really care about it anymore</p>



<p>the result is going to be just only eight bits because that&#8217;s the number that we started with</p>



<p>bunch of zeros what is you know the final answer let&#8217;s just compute this</p>



<p>real fast to decimal so this is 128 and then 64 so it&#8217;s gonna be 64 plus not 32</p>



<p>but 16 so 64 plus 16 that&#8217;s gonna be oops 16 that&#8217;s gonna be 80 and now we</p>



<p>just have to ask ourselves again as like a final step to double check yourself to</p>



<p>what you&#8217;re doing and that you got it right is just punch up 109 minus 29 just to make sure</p>



<p>109 minus 29 whoops what happened here 109 minus</p>



<p>oh i think i stole my subtraction key for the annotator 109 minus 29 is 80</p>



<p>so again you know if you&#8217;re if you&#8217;re trying to like you know write something down to do some</p>



<p>you know taking an exam or something you definitely want to double check yourself in several ways</p>



<p>As you can tell from this video alone</p>



<p>I got one of these things wrong because I forgot to input the bits as a step before adding one</p>



<p>So you know your final step should be actually trying to add two numbers together or subtract numbers or whatever</p>



<p>You&#8217;re doing to make sure that you got the binary correct</p>



<p>So let&#8217;s see</p>



<p>Hmm</p>



<p>I guess maybe your first indication that the result was going to be positive would be that</p>



<p>there&#8217;s a zero there. And just, you know, as a sanity check, you look at the top and you&#8217;re like,</p>



<p>well, I was going to subtract a small number from a larger number. So the result should probably be</p>



<p>positive, right? Like 29 is like way lower than 109. So it should be positive, which means the</p>



<p>final result should have a zero at that leftmost position. Okay, so that&#8217;s two&#8217;s compliment,</p>



<p>two&#8217;s complement how to convert numbers from positive to negative in two&#8217;s complement you</p>



<p>know what the sign bit means and all that stuff and how to perform subtraction via two&#8217;s complement</p>



<p>i hope you enjoyed this video thank you for watching i hope you learned a little bit of</p>



<p>stuff and had a little bit of fun see you in the next video hey everybody thanks for watching this</p>



<p>video again from the bottom of my heart i really appreciate it i do hope you did learn something</p>



<p>If you could do me a please, a small little favor, could you please subscribe and follow this channel or these videos or whatever it is you do on the current social media website that you&#8217;re looking at right now.</p>



<p>It would really mean the world to me and it&#8217;ll help make more videos and grow this community.</p>



<p>So we&#8217;ll be able to do more videos, longer videos, better videos, or just I&#8217;ll be able to keep making videos in general.</p>



<p>So please do me a kindness and subscribe.</p>



<p>in the middle of the night and I just wake up because I know somebody</p>



<p>subscribed or followed. It just wakes me up and I get filled with joy. That&#8217;s</p>



<p>exactly what happens every single time. So you could do it as a nice favor to me</p>



<p>or you could you could troll me if you want to just wake me up in the middle</p>



<p>of the night just subscribe and then I&#8217;ll just wake up. I promise that&#8217;s what</p>



<p>will happen. Also if you look at the middle of the screen right now you</p>



<p>should see a QR code which you can scan in order to go to the website which I</p>



<p>think is also named somewhere at the bottom of this video and it&#8217;ll take you</p>



<p>you to my main website where you can just kind of like see all the videos I published and the</p>



<p>services and tutorials and things that I offer and all that good stuff and if you have a suggestion</p>



<p>for clarifications or errata or just future videos that you want to see please leave a comment or if</p>



<p>you just want to say hey what&#8217;s up what&#8217;s going on you know just send me a comment whatever I also</p>



<p>wake up for those in the middle of the night I get I wake up in a cold sweat and I&#8217;m like</p>



<p>it would really mean the world to me. I would really appreciate it. So again,</p>



<p>thank you so much for watching this video and enjoy the cool music as I fade</p>



<p>into the darkness, which is coming for us all.</p>



<p>Thank you.</p>
<p>The post <a href="https://www.NeuralLantern.com/master-twos-complement-convert-subtract-negative-binary-numbers/">Master Two&#8217;s Complement: Convert &amp; Subtract Negative Binary Numbers</a> appeared first on <a href="https://www.NeuralLantern.com">NeuralLantern.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.NeuralLantern.com/master-twos-complement-convert-subtract-negative-binary-numbers/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Hex to Decimal Made Easy: Fun &#038; Simple Conversion Guide!</title>
		<link>https://www.NeuralLantern.com/hex-to-decimal-made-easy-fun-simple-conversion-guide/</link>
					<comments>https://www.NeuralLantern.com/hex-to-decimal-made-easy-fun-simple-conversion-guide/#respond</comments>
		
		<dc:creator><![CDATA[mike]]></dc:creator>
		<pubDate>Fri, 02 May 2025 09:23:46 +0000</pubDate>
				<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[Conversions]]></category>
		<category><![CDATA[Videos]]></category>
		<category><![CDATA[beginner coding]]></category>
		<category><![CDATA[binary to decimal]]></category>
		<category><![CDATA[coding for beginners]]></category>
		<category><![CDATA[coding guide]]></category>
		<category><![CDATA[computer science basics]]></category>
		<category><![CDATA[computer science tutorial]]></category>
		<category><![CDATA[hex to decimal]]></category>
		<category><![CDATA[hexadecimal to decimal]]></category>
		<category><![CDATA[hexadecimal tutorial]]></category>
		<category><![CDATA[learn to code]]></category>
		<category><![CDATA[number conversion]]></category>
		<category><![CDATA[number systems]]></category>
		<category><![CDATA[programming tutorial]]></category>
		<category><![CDATA[tech education]]></category>
		<guid isPermaLink="false">https://www.NeuralLantern.com/?p=95</guid>

					<description><![CDATA[<p>Learn to convert hexadecimal to decimal with this fun, easy guide! Perfect for beginners in coding and computer science. #HexToDecimal #LearnToCode</p>
<p>The post <a href="https://www.NeuralLantern.com/hex-to-decimal-made-easy-fun-simple-conversion-guide/">Hex to Decimal Made Easy: Fun &amp; Simple Conversion Guide!</a> appeared first on <a href="https://www.NeuralLantern.com">NeuralLantern.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<iframe loading="lazy" title="Hex to Decimal Made Easy: Fun &amp; Simple Conversion Guide!" width="1380" height="776" src="https://www.youtube.com/embed/yDk-fB52i0A?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
</div></figure>



<p>Confused by hexadecimal numbers? Don’t worry! This fun, step-by-step guide makes converting hex to decimal super easy, even for beginners. With clear examples and a chill vibe, you’ll master this computer science skill in no time. Perfect for students, coders, or anyone curious about number systems. Hit subscribe for more coding tutorials, and check out our site for extra resources! #HexToDecimal #CodingForBeginners #ComputerScience #LearnToCode</p>



<p>Introduction to Hexadecimal Conversion 00:00:00<br>Purpose of Conversion 00:00:11<br>Number System Basics 00:00:39<br>Hexadecimal Explanation 00:01:12<br>Converting Hex to Decimal 00:01:59<br>First Example Setup 00:02:35<br>Decimal Place Value Recap 00:03:02<br>Hexadecimal Place Value 00:05:14<br>Formula for Conversion 00:05:43<br>Translating Hex Letters 00:08:17<br>First Example Calculation 00:09:51<br>Second Example Introduction 00:11:14<br>Second Example Conversion 00:11:58<br>Second Example Result 00:13:11<br>Conclusion and Call to Action 00:14:00</p>



<p>Thanks for watching!</p>



<p>Find us on other social media here:</p>



<ul class="wp-block-list">
<li>https://www.NeuralLantern.com/social</li>
</ul>



<p>Please help support us!</p>



<ul class="wp-block-list">
<li>Subscribing + Sharing on Social Media</li>



<li>Leaving a comment or suggestion</li>



<li>Subscribing to our Blog</li>



<li>Watching the main &#8220;pinned&#8221; video of this channel for offers and extras</li>
</ul>



<p>Hello there. Let&#8217;s talk about converting hexadecimal to decimal.</p>



<p>So why would you do this? Of course, sometimes in computer science and other realms, you may be</p>



<p>faced with a number that looks like this, and it&#8217;s got some letters in there, and it&#8217;s weird,</p>



<p>and you&#8217;re thinking, oops, not a V. That wouldn&#8217;t work. Not a G. And you&#8217;re thinking like, what does</p>



<p>what does this number mean in decimal well this is a number that is real and we can just change</p>



<p>the way it&#8217;s represented uh to decimal so that we can understand what it is so just like a quick</p>



<p>recap if you haven&#8217;t watched my other videos yet uh in decimal we have a base 10 system which just</p>



<p>basically means we have these characters zero one two three four five six seven eight nine there</p>



<p>base is 10. In binary, of course, we have base two, which is just, you know, we have a zero and a one</p>



<p>because in the computer, which is why we learn binary, we just have on and off basically for</p>



<p>every single, you know, part of the computer. There&#8217;s just like a certain voltage or there&#8217;s</p>



<p>not a certain voltage and that&#8217;s it. And then for hexadecimal, which is a way to represent the same</p>



<p>numbers, but just in a more compact way. It&#8217;s a little bit more compact than decimal. It&#8217;s a lot</p>



<p>than binary we can say that this is base 16 which means we have 16 total characters that we can work</p>



<p>with zero one two three four five six seven eight nine and once we run out of numbers we just start</p>



<p>using letters so a b c d e f so there are 16 total characters if we include the zero which means we</p>



<p>So that&#8217;s the basics of you know the number basis let&#8217;s uh let&#8217;s work out how to convert a hex</p>



<p>number to decimal. So I&#8217;m going to say ox because in hex when you write down a hex number you should</p>



<p>usually put ox in front of it unless the program you&#8217;re working with doesn&#8217;t understand that but</p>



<p>usually especially for a human reader you should do it this way. So I&#8217;m going to just type like a</p>



<p>few random maybe I have to I have to keep the number small because hex will explode it&#8217;ll be</p>



<p>not careful. So I&#8217;m going to put like a I don&#8217;t know, maybe a few decimal numbers there or a few</p>



<p>like digits that are zero to nine, then I&#8217;ll just to make it more interesting, I&#8217;ll put some letters</p>



<p>in there. How about like an E there? And then I don&#8217;t know, like, we&#8217;ll do a B there. Okay, so</p>



<p>how many do I have? 12341234? How about we get rid of? Now, let&#8217;s go for it. This is going to be an</p>



<p>So this is our starting number hexadecimal. What we need to do is understand that, well,</p>



<p>a recap if you haven&#8217;t watched my other videos yet. In decimal we have, let&#8217;s say, 0, 1, 2, 3,</p>



<p>4, 5, 6. You know that the first digit has a strength of 1. You multiply 6 by 1 to understand</p>



<p>the real power of that 6. For the 5, you know that it has a power of 10 or a strength of 10</p>



<p>10 because it&#8217;s the next digit over you know to the left same thing for the four it&#8217;s like got a</p>



<p>strength of 100 and so every time you move to the left the strength of the digit increases by a</p>



<p>factor of 10. why does it increase by a factor of 10 because decimal is base 10 because we have 10</p>



<p>possible digits we can represent for each character okay so by the time we get to that</p>



<p>left, we have a strength of 100,000. So, you know, if you wanted to really understand 100,000,</p>



<p>if you really wanted to understand, you know, how powerful, let me, let me give some spacing here.</p>



<p>So this feels better. Okay. If you really wanted to understand like, you know, what is the strength?</p>



<p>What is like the actual value of this digit right here? You&#8217;re imagining this is like 100,000.</p>



<p>this digit here you&#8217;re imagining that this is two of ten thousand you know two times ten thousand</p>



<p>and so forth so uh uh just like another recap the first digit is really 10 to the zero power</p>



<p>like in terms of the strength because if you multiply um let me pin this to the top</p>



<p>if you multiply you know 10 to the something power and you start at zero with the most</p>



<p>the weakest digit 10 to the zero power gives a strength of one and then every time you move over</p>



<p>to the left you just increase the exponent there by one so 10 to the first power is going to be 10</p>



<p>that&#8217;s what that five has got so it&#8217;ll be five times 10 to give us an understanding of how you</p>



<p>know powerful that digit is move one over to the left it&#8217;s 10 to the second power so that&#8217;s 100</p>



<p>move one over to the left it&#8217;s 10 to the third power and so forth until we get to 10 to the fifth</p>



<p>1 times 10 to the fifth power to understand how powerful that is so we can do the same exact thing</p>



<p>with hexadecimal except instead of raising 10 to a power we raise 16 to a power because hexadecimal</p>



<p>is base 16 whereas decimal is base 10. so that means this e is is uh you know 10 to the or sorry</p>



<p>16 to the zero power and then that 3 is 16 to the 1 power and that f is 16 to the 2 power and so</p>



<p>16 to the 2 power and so forth so first what we should do is let&#8217;s write out a</p>



<p>formula which won&#8217;t work in a calculator because we&#8217;re going to put some letters</p>



<p>in there and then later we&#8217;ll translate the letters to actual values so we&#8217;ll</p>



<p>start off with the e we&#8217;ll say e times 16 to the something power it&#8217;s going to be</p>



<p>16 to the zero power okay so then the next digit is 3 so 3 times 16 to the</p>



<p>And then the next thing is going to be F times 16 to the second power.</p>



<p>And just as a reminder here, I&#8217;m starting with zero with the smallest digit.</p>



<p>And I&#8217;m just working my way up in steps of one.</p>



<p>So it&#8217;s zero power or raised to zero and raised to one and raised to two and just so forth all the way to the left.</p>



<p>That number will just keep increasing by one.</p>



<p>The exponent will increase by one.</p>



<p>times 16 to the third power do it again um one times 16 to the fourth power do it again</p>



<p>um d times 16 to the fourth power oh what did i do did i erase something</p>



<p>0, 1, 2, 3, 4, 5.</p>



<p>Oh, that was supposed to be a 5.</p>



<p>Okay, maybe it&#8217;s good that I thought I made a mistake</p>



<p>because that drew my attention to the bad exponent.</p>



<p>Okay, so after the D is a B.</p>



<p>B times 16 to the 6th power.</p>



<p>And then one more.</p>



<p>We&#8217;ll say 6 times 16 to the 7th power.</p>



<p>And then another one.</p>



<p>A times 16 to the, whoops, to the eighth power.</p>



<p>And another one.</p>



<p>One times 16 to the ninth power.</p>



<p>Ninth power.</p>



<p>Okay.</p>



<p>So just double check your work real fast.</p>



<p>You know, because I make typos all the time and I get things wrong all the time.</p>



<p>So just double check.</p>



<p>Zero, one, two, three, four, five, six, seven, eight, nine.</p>



<p>It&#8217;s sequential.</p>



<p>Double check the digits.</p>



<p>6 b d 1 3 f 3 e okay so i got that right i&#8217;m not going to erase my work because if i end up screwing</p>



<p>up the next part oh man is it going to be a hassle to correct so i&#8217;m just going to copy paste it here</p>



<p>and then i&#8217;m going to start translating the letters to numbers anytime you see a number here like one</p>



<p>time something it&#8217;s just one but every time you see a letter you have to translate that into</p>



<p>in decimal. Remember in hex, we&#8217;ll say, what can I do?</p>



<p>I can say A, B, C, D, E, F.</p>



<p>And I can say that the A is worth 10.</p>



<p>The B is worth 11.</p>



<p>The C is worth 12.</p>



<p>And the D is worth 13.</p>



<p>The E is worth 14 and the F is worth 15.</p>



<p>Well, maybe I should do the other numbers too.</p>



<p>five, six, seven, eight, nine,</p>



<p>just so we have a visual reminder</p>



<p>of like what we&#8217;re even looking at.</p>



<p>And I won&#8217;t write down what the digits are worth</p>



<p>because they&#8217;re worth themselves, right?</p>



<p>So like zero through nine, it&#8217;s just worth zero through nine.</p>



<p>So now that we have this little translation table up here,</p>



<p>anytime we see a letter,</p>



<p>we can just translate it very quickly to the decimal value.</p>



<p>So A is worth 10, we&#8217;ll put a 10 there.</p>



<p>Maybe I&#8217;ll add some spacing so that this continues to line up.</p>



<p>I see a B here, so the B is gonna be worth 11,</p>



<p>11 add another space so it lines up i&#8217;m running out of room but i&#8217;ll try the d is worth 13 add</p>



<p>another space so it lines up and then the f is worth 15 add another space so it lines up the e</p>



<p>is worth 14 so i&#8217;ll add another space so it lines up okay let me just double check my work here a b d</p>



<p>So now I&#8217;ve got like a big formula that I wrote out.</p>



<p>I can literally now, I mean, you can do this in your head if you&#8217;re like a crazy genius,</p>



<p>but I&#8217;m just going to paste this into a calculator and hit enter.</p>



<p>And this is the number that we had originally in hex.</p>



<p>Maybe I&#8217;ll put commas here to make things more fun.</p>



<p>I don&#8217;t know.</p>



<p>You don&#8217;t really need to do that, but I&#8217;m going to.</p>



<p>So for me, it&#8217;s easier to read.</p>



<p>this is uh like 113 trillion 478 no wait that&#8217;s a million and that&#8217;s a bill okay so 113 mil a</p>



<p>billion 478 million 25 022. let me punch up my personal calculator here to make sure that i&#8217;m</p>



<p>getting this right i&#8217;m not going to show this on the screen because i&#8217;ve just got this up</p>



<p>on my host machine bet you didn&#8217;t know i&#8217;m inside of vm right now surprised you didn&#8217;t know that</p>



<p>decimal and the number is supposed to be 113478025022 okay so we did this right we now know how</p>



<p>to convert from hexadecimal to decimal and it&#8217;s pretty awesome right okay let&#8217;s do another number</p>



<p>one that is not quite as hard let&#8217;s see how many digits do we have here one two three i think we</p>



<p>5, 6, 7, 8, 9, 10.</p>



<p>Yeah, okay, we had 10.</p>



<p>Let&#8217;s do a five-digit hex number.</p>



<p>Okay, maybe I&#8217;ll copy…</p>



<p>I&#8217;ll copy just this table at the top</p>



<p>since you don&#8217;t need it anymore,</p>



<p>but I&#8217;m going to need it to do my calculations.</p>



<p>So we&#8217;ll do 1, 2, 3, 4, 5,</p>



<p>and I&#8217;ll just start randomly changing</p>



<p>some of these numbers.</p>



<p>Like an 8 over here, and how about like a 2?</p>



<p>So I&#8217;ve got five numbers.</p>



<p>This is OX.</p>



<p>I&#8217;m going to say this is a hexadecimal number.</p>



<p>Kind of ambiguous if we tell the reader this is a hex number,</p>



<p>but then we put OX.</p>



<p>Kind of don&#8217;t really need to tell them that it&#8217;s hex</p>



<p>because OX tells you it&#8217;s hex.</p>



<p>It&#8217;s not even part of the value.</p>



<p>So let&#8217;s get on with it.</p>



<p>I&#8217;ll start by just doing 8 times 16 to the something power,</p>



<p>which is going to be 0 for that first position.</p>



<p>the power as we go to the left so it&#8217;s going to be 1 times 16 to the first power and then it&#8217;s</p>



<p>going to be f times 16 to the second power and then it&#8217;s going to be 2 times 16 to the third</p>



<p>power oh no my thoughts are wandering i think i&#8217;m getting bored of recording this video i&#8217;m starting</p>



<p>to the fourth power but honestly why couldn&#8217;t they end up together so and</p>



<p>then I think one two three four five okay so that&#8217;s five digits a to f one</p>



<p>eight a to f one eight all right zero one two three four just to make sure</p>



<p>that I got my exponents right copy paste it so I don&#8217;t have to repeat my work if</p>



<p>I get something wrong I&#8217;m gonna translate the letters into numbers so a</p>



<p>becomes 10 f becomes 15 and the other numbers are fine as is I can just copy</p>



<p>fine as is I can just copy paste this whole thing stick it into a calculator and now I know that</p>



<p>this number is actually 667 416 with a little comma in there don&#8217;t put commas if you are taking an</p>



<p>exam somewhere if you&#8217;re watching my video to help with your exam because most most likely the exam</p>



<p>that you&#8217;re taking will not accept a comma it&#8217;s not been pre-programmed for a comma I don&#8217;t know</p>



<p>If you start typing numbers and a comma just shows up, then it probably was programmed for a comma.</p>



<p>But don&#8217;t assume it might be a string match and not a numeric match.</p>



<p>So be careful out there.</p>



<p>Be careful.</p>



<p>So 667-416.</p>



<p>Let me punch this into my personal calculator just to make sure I got this right and I don&#8217;t have to issue an errata.</p>



<p>667-416.</p>



<p>All right.</p>



<p>We&#8217;ve done it.</p>



<p>We know how to convert hexadecimal numbers into decimal numbers.</p>



<p>Thank you so much for watching this video. I hope you enjoyed it and had a little bit of fun and</p>



<p>learned a little bit of stuff. I&#8217;ll see you in the next video. Hey everybody, thanks for watching</p>



<p>this video again from the bottom of my heart. I really appreciate it. I do hope you did learn</p>



<p>something and have some fun. If you could do me a please, a small little favor, could you please</p>



<p>subscribe and follow this channel or these videos or whatever it is you do on the current social</p>



<p>It would really mean the world to me and it&#8217;ll help make more videos and grow this community.</p>



<p>So we&#8217;ll be able to do more videos, longer videos, better videos, or just I&#8217;ll be able to keep making videos in general.</p>



<p>So please do me a kindness and subscribe.</p>



<p>You know, sometimes I&#8217;m sleeping in the middle of the night and I just wake up because I know somebody subscribed or followed.</p>



<p>It just wakes me up and I get filled with joy.</p>



<p>That&#8217;s exactly what happens every single time.</p>



<p>So you could do it as a nice favor to me or you could troll me if you want to just wake me up in the middle of the night.</p>



<p>Just subscribe.</p>



<p>just wake me up in the middle of the night just subscribe and then I&#8217;ll just</p>



<p>wake up I promise that&#8217;s what will happen also if you look at the middle of</p>



<p>the screen right now you should see a QR code which you can scan in order to go</p>



<p>to the website which I think is also named somewhere at the bottom of this</p>



<p>video and it&#8217;ll take you to my main website where you can just kind of like</p>



<p>see all the videos I published and the services and tutorials and things that I</p>



<p>for clarifications or errata or just future videos that you want to see please leave a comment or if</p>



<p>you just want to say hey what&#8217;s up what&#8217;s going on you know just send me a comment whatever I also</p>



<p>wake up for those in the middle of the night I get I wake up in a cold sweat and I&#8217;m like</p>



<p>it would really it really mean the world to me I would really appreciate it so again thank you so</p>



<p>much for watching this video and enjoy the cool music as as I fade into the darkness which is</p>



<p>the darkness which is coming for us all.</p>



<p>Thank you.</p>
<p>The post <a href="https://www.NeuralLantern.com/hex-to-decimal-made-easy-fun-simple-conversion-guide/">Hex to Decimal Made Easy: Fun &amp; Simple Conversion Guide!</a> appeared first on <a href="https://www.NeuralLantern.com">NeuralLantern.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.NeuralLantern.com/hex-to-decimal-made-easy-fun-simple-conversion-guide/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Binary to Decimal Made Easy: Fun Crash Course for Beginners</title>
		<link>https://www.NeuralLantern.com/binary-to-decimal-made-easy-fun-crash-course-for-beginners/</link>
					<comments>https://www.NeuralLantern.com/binary-to-decimal-made-easy-fun-crash-course-for-beginners/#respond</comments>
		
		<dc:creator><![CDATA[mike]]></dc:creator>
		<pubDate>Sun, 06 Apr 2025 01:41:06 +0000</pubDate>
				<category><![CDATA[Videos]]></category>
		<category><![CDATA[base 2 explained]]></category>
		<category><![CDATA[beginner coding]]></category>
		<category><![CDATA[binary conversion]]></category>
		<category><![CDATA[binary for beginners]]></category>
		<category><![CDATA[binary math]]></category>
		<category><![CDATA[binary to decimal]]></category>
		<category><![CDATA[binary tricks]]></category>
		<category><![CDATA[binary tutorial]]></category>
		<category><![CDATA[coding 101]]></category>
		<category><![CDATA[computer science basics]]></category>
		<category><![CDATA[decimal to binary]]></category>
		<category><![CDATA[how to read binary]]></category>
		<category><![CDATA[learn binary]]></category>
		<category><![CDATA[number systems]]></category>
		<category><![CDATA[tech explained]]></category>
		<guid isPermaLink="false">https://www.NeuralLantern.com/?p=82</guid>

					<description><![CDATA[<p>Binary got you baffled? Let’s break it down! In this fun crash course, I’ll show you how to convert binary to decimal step-by-step—super easy, no stress. We’ll go from 765,432&#8230;</p>
<p>The post <a href="https://www.NeuralLantern.com/binary-to-decimal-made-easy-fun-crash-course-for-beginners/">Binary to Decimal Made Easy: Fun Crash Course for Beginners</a> appeared first on <a href="https://www.NeuralLantern.com">NeuralLantern.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-embed is-type-wp-embed is-provider-rumble-com wp-block-embed-rumble-com"><div class="wp-block-embed__wrapper">
<iframe loading="lazy" class="wp-embedded-content" sandbox="allow-scripts" security="restricted" title="Binary to Decimal Made Easy: Fun Crash Course for Beginners" src="https://rumble.com/embed/v6pisf7/#?secret=fLsPJTh6ug" data-secret="fLsPJTh6ug" width="1000" height="563" frameborder="0"></iframe>
</div></figure>



<p>Binary got you baffled? Let’s break it down! In this fun crash course, I’ll show you how to convert binary to decimal step-by-step—super easy, no stress. We’ll go from 765,432 in decimal to 10101111 in binary (that’s 335, btw), with tricks to eyeball it fast. Perfect for beginners or anyone who loves a good tech challenge. Hit subscribe—I wake up in a cold sweat when you do, and it means the world! More vids coming your way!</p>



<p>Introduction to Binary and Decimal 00:00:00<br>Understanding Decimal System 00:00:44<br>Decimal Position Strengths 00:01:39<br>Decimal Formula Explanation 00:03:48<br>Transition to Binary System 00:06:31<br>Binary Position Strengths 00:07:19<br>Binary Formula Breakdown 00:10:46<br>Calculating Binary Example (335) 00:12:55<br>Quick Binary Conversion Trick 00:15:24<br>Memorizing Binary Positions 00:13:52<br>Small Binary Example (19) 00:15:43<br>Closing and Subscription Request 00:16:48</p>



<p>Thanks for watching!</p>



<p>Find us on other social media here:</p>



<ul class="wp-block-list">
<li>https://www.NeuralLantern.com/social</li>
</ul>



<p>Please help support us!</p>



<ul class="wp-block-list">
<li>Subscribing + Sharing on Social Media</li>



<li>Leaving a comment or suggestion</li>



<li>Subscribing to our Blog</li>



<li>Watching the main &#8220;pinned&#8221; video of this channel for offers and extras</li>
</ul>



<p>Hello there. Let&#8217;s talk about converting binary to decimal.</p>



<p>Just a quick recap for those of you who don&#8217;t know. Watch my other videos if you&#8217;re not sure</p>



<p>about number bases, but basically, you know, decimal is a number system that has 10 characters</p>



<p>to represent a number. So 0, 1, 2, 4, 5, 6, 7, 8, 9. That&#8217;s 10 characters in decimal.</p>



<p>In binary, we just have two characters.</p>



<p>So it&#8217;s base two, whereas decimal is base 10.</p>



<p>How can we convert between the two?</p>



<p>Well, first, before we can try to convert between the two,</p>



<p>we should try to understand what&#8217;s really going on with normal decimal representations.</p>



<p>So if I have a decimal number here, and I say, I don&#8217;t know,</p>



<p>let&#8217;s just type a couple of random numbers.</p>



<p>How do we really know what this value is?</p>



<p>How do we kind of understand what is the meaning?</p>



<p>Okay, so you know that, you know,</p>



<p>if you just kind of look at this for a second,</p>



<p>you&#8217;ll realize this is 765,000, right?</p>



<p>765,432.</p>



<p>How do we know that this is 700,000?</p>



<p>Because it&#8217;s in a certain position.</p>



<p>It&#8217;s like, you know, several digits to the left.</p>



<p>How do we know that the next one represents 65,000?</p>



<p>Well, it&#8217;s one less to the left.</p>



<p>uh it&#8217;s a tenth of the like power of the seven digit same thing for the five how do we know</p>



<p>that&#8217;s a thousand same thing for the four and the three and the two what we really do is we end up</p>



<p>deciding okay you know what the uh the first digit here on the right side that two uh the strength of</p>



<p>of one. So like, you know, two times one is just two. So whatever, whatever that digit is, if it</p>



<p>was a five, it would just be a five, five times one is five, right? So the strength of the very</p>



<p>first digit on the right side is just one. Every time we move one digit to the left, we multiply</p>



<p>the strength by 10. The reason we multiply the strength by 10 is because there are 10 possible</p>



<p>digits, or 10 possible characters that we can use in decimal. Makes sense, right? So that means the</p>



<p>Makes sense, right?</p>



<p>So that means the three, we know that represents, you know, an addition of 30 because that&#8217;s</p>



<p>the 10th strength place.</p>



<p>Same thing for the four.</p>



<p>We multiply 10 by 10 again to get 100 in that position.</p>



<p>So this one has a strength of 100.</p>



<p>I&#8217;m writing this vertically.</p>



<p>Hopefully this is not too messy, but I&#8217;m hoping you&#8217;ll understand.</p>



<p>Well, I don&#8217;t know.</p>



<p>Maybe if I space this out, does that make it better or worse?</p>



<p>maybe it makes it slightly better i don&#8217;t know i&#8217;m going to roll with it</p>



<p>what can i say i&#8217;m a rebel okay so i live dangerously the five we know that&#8217;s worth</p>



<p>five thousand because again the four position over here you know that third digit it had a</p>



<p>strength of 100 so we multiply that strength by 10 going to the left to to end up with a thousand</p>



<p>to end up with a thousand.</p>



<p>So same thing with the six.</p>



<p>I&#8217;m not going to explain that any further.</p>



<p>You know, it&#8217;s got a strength of, you know, 10,000.</p>



<p>Okay.</p>



<p>And then the seven, it&#8217;s got a strength of 100,000.</p>



<p>And it just keeps going and going and going to millions and billions and trillions</p>



<p>and however far you actually want to go.</p>



<p>That&#8217;s how we understand the decimal numbers</p>



<p>that we&#8217;re looking at.</p>



<p>How could you imagine this in terms of a formula?</p>



<p>Well, we&#8217;re really raising something to the 10th power.</p>



<p>If you think about this, the one,</p>



<p>we could imagine that the value one</p>



<p>is actually 10 to the zero power</p>



<p>because anything raised to the zero power is just a one.</p>



<p>Let me pull up this calculator real fast.</p>



<p>I got to stick that on my desktop in the future.</p>



<p>If we say 10 to the zero power, it&#8217;s just one.</p>



<p>Any number to the zero power is just one.</p>



<p>Okay, so then we would multiply that strength</p>



<p>by the actual digit that we see,</p>



<p>the character that we see.</p>



<p>It&#8217;s a two.</p>



<p>Okay, so that&#8217;s going to be two times 10 to the zero power.</p>



<p>I&#8217;m going to put that in parentheses</p>



<p>to keep it a little bit clean or somewhat cleaner.</p>



<p>So now when we go one to the left</p>



<p>to look at that three digit,</p>



<p>to look at that three digit, we end up with three times something.</p>



<p>Let me get a space here for my brain.</p>



<p>Times 10 to the something power.</p>



<p>Well, every time we go to the left, we just really have to increase the power by one.</p>



<p>It&#8217;s 10 to the first power because we&#8217;re looking for actually just the number 10.</p>



<p>So if we say 10 to the first power on that calculator, it&#8217;s 10.</p>



<p>So then, you know, just keep repeating the process.</p>



<p>10 to the second power. And that should be 100. So if I say 10 to the second power, it&#8217;s 100.</p>



<p>All right. And, you know, we&#8217;re adding all the positions together, even though we&#8217;re multiplying</p>



<p>the digit by its strength. So I&#8217;m going to say five times 10 to the third power. And then again,</p>



<p>just to double check here, 10 to the third power is 1000. So you can see the five was supposed to</p>



<p>and then again we&#8217;ll say six times ten to the fourth power and then just double check here</p>



<p>the fourth power should be a thousand sorry ten thousand and then we&#8217;ll do it one last time we&#8217;ll</p>



<p>say seven times ten to the fifth power which should be a hundred thousand all right so now</p>



<p>that we&#8217;ve written this all out you know this is kind of madness right what you can do now</p>



<p>do now is you can put this into the calculator and it should give you the exact same number that</p>



<p>we started with. We should see 765432, unless there&#8217;s a typo. 765432. Nice. Okay, that might</p>



<p>have seemed like it was a little bit of a waste of time, but it&#8217;s not because now we kind of</p>



<p>understand the breakdown of the different positions of the digits in decimal, which means</p>



<p>now we can do the same thing in binary, basically the exact same thing, except just use a power of,</p>



<p>use a two to some power rather than a 10 to some power because the only reason we use 10 down here</p>



<p>it says we were in decimal that has a base of 10 now let&#8217;s go into binary</p>



<p>which is um a base of two so i&#8217;m going to just i guess maybe what did i do wrong</p>



<p>i hit something and it like did a space i don&#8217;t even want to know i don&#8217;t even want to know</p>



<p>okay so let&#8217;s do a binary number i&#8217;m just going to type a few random digits</p>



<p>a few random digits. I don&#8217;t know what number this is yet, but let&#8217;s work it out slowly</p>



<p>in the same way. You know what, maybe instead of doing the formula first and only, let&#8217;s do</p>



<p>both parts like we did with decimal. So what&#8217;s the position, what&#8217;s the strength of the position</p>



<p>for that first character? Well, I said before the first character is always just going to be,</p>



<p>sorry, the first digit is always just going to be a one, right? That&#8217;s going to be true</p>



<p>So I&#8217;m going to say this has a strength of 1.</p>



<p>How do we know it&#8217;s a strength of 1?</p>



<p>Because we&#8217;ll take 2 to the something power.</p>



<p>We start at 0 for that first position, and it&#8217;s going to give us a 1.</p>



<p>Okay.</p>



<p>So the strength of this one, I already know binary.</p>



<p>So I just know off the top of my head that to go to the left,</p>



<p>the strength just multiplies by 2.</p>



<p>And that&#8217;s pretty easy after you start memorizing it.</p>



<p>I haven&#8217;t quite memorized hexadecimal yet, but maybe you will in another video.</p>



<p>So I&#8217;m going to multiply one by two and I&#8217;m going to end up with two.</p>



<p>Double check over here in the calculator.</p>



<p>Two to the first power is two.</p>



<p>So then the strength of this next digit should be four.</p>



<p>Two times two is four, right?</p>



<p>So let&#8217;s do two to the second power.</p>



<p>That&#8217;s four.</p>



<p>Multiply by two again.</p>



<p>It&#8217;s going to be eight.</p>



<p>Double check over here.</p>



<p>Two to the third power is eight.</p>



<p>The next digit is going to be 16 of its strength.</p>



<p>So I&#8217;m going to write this vertically again.</p>



<p>So it&#8217;s going to be 16.</p>



<p>Double check over here with the calculator.</p>



<p>Double check over here with the calculator, 2 to the 4th power is 16.</p>



<p>Next digit is going to be 32.</p>



<p>Double check with the calculator, 2 to the 5th power.</p>



<p>And things are starting to get messy, so I think I&#8217;m going to like space everything out probably.</p>



<p>Just to make it easier to read.</p>



<p>Tell me if you think this makes it actually easier to read or if I&#8217;m making it way harder.</p>



<p>I think I&#8217;m making it easier.</p>



<p>Okay, so we got 32.</p>



<p>two. Next one up is going to be 64. Just multiply it by two. Double check two to the sixth power.</p>



<p>That&#8217;s going to be 64. And then the biggest one that we&#8217;ve written down is going to be 128.</p>



<p>Double check it. Six to the seventh power is 128. We could go on and on and on, but I&#8217;m just going</p>



<p>to leave it here because we, I hope we have a pretty good idea of, you know, what this means.</p>



<p>delineation or like a delimiter showing us that these are just representing the strengths and</p>



<p>this is the actual number. Okay, so how can we write this out in a formula?</p>



<p>Whoa, what did I do wrong? Did you see that? Oh no. Hang on a second.</p>



<p>I think I missed it. How many digits are there? If there are eight digits, then I definitely forgot</p>



<p>something. No, no. Okay. There are nine digits, so the last one should be 256. Okay.</p>



<ol start="256" class="wp-block-list">
<li>Okay. So I got it all lined up. At some point I must have not lined it up. My apologies,</li>
</ol>



<p>but hey, maybe I&#8217;m making these mistakes on purpose to make sure that you&#8217;re paying attention.</p>



<p>You never know. I want you to think. So 256 is going to be the next number. Double check it with</p>



<p>the calculator. Two to the eighth power, 256. Cool. By the way, a quick trick in binary that</p>



<p>the actual highest number that you can represent in an unsigned binary integer is basically the</p>



<p>strength of the highest digit, you know, this 256 here, multiplied by two and then subtract one</p>



<p>from it. So 256 multiplied by two is going to be 512. So it&#8217;s going to be 511. So I could</p>



<p>represent a number between zero and 511 or 512 possible combinations. Okay, so now let&#8217;s work</p>



<p>let&#8217;s work out the formula.</p>



<p>See 16, 30, 16, 40, okay, I did it okay.</p>



<p>I probably should have rehearsed this.</p>



<p>So let&#8217;s do each position.</p>



<p>So it&#8217;s either always gonna be one times something</p>



<p>or zero times something, right?</p>



<p>Because binary, these characters can only be one or a zero.</p>



<p>So let&#8217;s do on the, starting from the right,</p>



<p>we&#8217;ll say one times two to the something power.</p>



<p>It&#8217;s gonna be two to the zero power</p>



<p>You know, just going to be a one.</p>



<p>Working our way over to the left, it&#8217;s going to be one times two to the something power</p>



<p>to the first power because it just increases every time the power increases.</p>



<p>We have four ones in a row here.</p>



<p>I got to try to remember that.</p>



<p>This is where I&#8217;m going to start making lots and lots of typos.</p>



<p>Two to the second power.</p>



<p>And then we have another one.</p>



<p>One, two, three, four, one times two to the third power.</p>



<p>And then again, we are going to hit a zero.</p>



<p>So it&#8217;s going to be zero times two to the something power.</p>



<p>You might be tempted to omit the zeros.</p>



<p>You can if you want to.</p>



<p>But for me personally, it helps me quickly visually see that I&#8217;m getting the powers in</p>



<p>the right order.</p>



<p>I can see two to the zero power, first power, second power, third power, fourth power.</p>



<p>Sometimes when I omit the zeros, I end up kind of like messing up the order of the powers</p>



<p>and or the order of the exponents.</p>



<p>of the exponents and I have to redo everything all over again.</p>



<p>So I just keep it this way.</p>



<p>Okay, so it&#8217;s one, one, one, one, one, one, one, one, zero.</p>



<p>So there&#8217;s another zero that we need</p>



<p>times two to the fifth power.</p>



<p>So we got both of those zeros now.</p>



<p>And then we need another one times two to the sixth power.</p>



<p>And then we need</p>



<p>0 times 2 to the 7th power.</p>



<p>Okay.</p>



<p>And then we have another 1 times 2 to the 8th power.</p>



<p>And I know we&#8217;re supposed to be done on 8</p>



<p>because that&#8217;s what we were doing before.</p>



<p>The 256 strength.</p>



<p>So unless I made some mistakes here,</p>



<p>this is probably the number that we can punch up into the calculator</p>



<p>to see what this binary number is.</p>



<p>So I&#8217;m going to punch it up.</p>



<p>Huge.</p>



<p>It says that it&#8217;s the number 335.</p>



<p>Let&#8217;s see if that&#8217;s actually right.</p>



<p>I&#8217;m going to punch this up in my personal calculator real fast.</p>



<p>I&#8217;m going to say 10101111.</p>



<p>And the expression is decimal 335.</p>



<p>Yep.</p>



<p>So that&#8217;s it.</p>



<p>We know how to convert from binary to decimal.</p>



<p>And just again, like as a quick shorthand,</p>



<p>it&#8217;s probably a good idea if you&#8217;re involved in computer science,</p>



<p>to memorize these positions up to maybe</p>



<p>6, 5, 5, 3, 6.</p>



<p>That might sound a little extreme sometimes,</p>



<p>but I don&#8217;t know.</p>



<p>Personally, I&#8217;m not like the most advanced</p>



<p>binary reader at all times,</p>



<p>but I can remember up to that much.</p>



<p>And what do I mean when I&#8217;m saying that?</p>



<p>I&#8217;m saying, you know, start with a 1, 2, 4, 8,</p>



<p>8, 2, 56, 5, 12, 1, 2, 4, 2, 0, 4, 8, 4, 0, 9, 6, 8, 1, 9, 2, 1, 6, 3, 8, 4.</p>



<p>Took me a while to remember that one.</p>



<p>3, 2, 7, 6, 8, 6, 5, 5, 3, 6.</p>



<p>So if you think about it, how many bits is this?</p>



<p>1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16.</p>



<p>Right here, 16.</p>



<p>That&#8217;ll give you two bytes worth of memorization or a word on many systems.</p>



<p>on many systems. For me personally, I just, I like to go up to 6, 5, 5, 3, 5 because</p>



<p>remember I was saying, you know, what is the highest number that you can go up to</p>



<p>with a certain number of bits? It&#8217;s always the power or the strength of the highest bit</p>



<p>multiplied by two and then subtract one. So when I remember 6, 5, 5, 3, 6, that tells me that if I</p>



<ol start="65535" class="wp-block-list">
<li>This is very, very useful if you&#8217;re going to be working with binary numbers a lot,</li>
</ol>



<p>or if you&#8217;re taking exams or whatever it is that you&#8217;re doing, I would recommend everyone do this.</p>



<p>Okay. What do you say? What do you say we do another binary number, but we&#8217;ll just do something</p>



<p>a little bit smaller to make it easy. Okay. So by the way, when you start to memorize these positions,</p>



<p>start to eyeball it, which is really, really fast and a good idea. Like I can see those two</p>



<p>numbers right there. I know the first one is a one and the second one is a two. So that means the</p>



<p>one and the one are just going to be a value of three. Then I just quickly go, all right, one,</p>



<p>two, four, eight, one, two, four, eight, 16. So it&#8217;s going to be 16 plus three. So it&#8217;s going to</p>



<p>be 19. I guarantee it. Let&#8217;s, let&#8217;s double check this real fast. We&#8217;ll say one times two to the</p>



<p>and then we&#8217;ll say 1 times 2 to the first power</p>



<p>and then we&#8217;ll say 0 times 2 to the second power</p>



<p>and then we&#8217;ll say 0 times 2 to the third power</p>



<p>and then we&#8217;ll say 1 times 2 to the fourth power</p>



<p>and if I didn&#8217;t go too fast and make a bunch of typos</p>



<p>it should be the number 19</p>



<p>So there is a lot of benefit in memorizing the strength of these different positions.</p>



<p>I personally never remember very much beyond 256 when I&#8217;m actually trying to work out a number</p>



<p>conversion, but when I&#8217;m just thinking of how to compute things, it&#8217;s faster if I can go up to</p>



<ol start="65536" class="wp-block-list">
<li>Okay, I hope you enjoyed this video. I hope you learned a little bit of stuff. I hope</li>
</ol>



<p>you had a little bit of fun. I&#8217;ll see you in the next one.</p>



<p>Hey everybody! Thanks for watching this video again from the bottom of my heart.</p>



<p>I really appreciate it. I do hope you did learn something and have some fun.</p>



<p>If you could do me a please, a small little favor, could you please subscribe</p>



<p>and follow this channel or these videos or whatever it is you do on the current</p>



<p>social media website that you&#8217;re looking at right now. It would really mean the</p>



<p>world to me and it&#8217;ll help make more videos and grow this community so we&#8217;ll</p>



<p>be able to do more videos, longer videos, better videos or just I&#8217;ll be able to</p>



<p>just I&#8217;ll be able to keep making videos in general so please do do me a kindness and uh and subscribe</p>



<p>you know sometimes I&#8217;m sleeping in the middle of the night and I just wake up because I know</p>



<p>somebody subscribed or followed it just wakes me up and I get filled with joy that&#8217;s exactly what</p>



<p>happens every single time so you could do it as a nice favor to me or you could you could troll me</p>



<p>if you want to just wake me up in the middle of the night just subscribe and then I&#8217;ll I&#8217;ll just</p>



<p>wake up I promise that&#8217;s what will happen also uh if you look at the middle of the screen right now</p>



<p>screen right now you should see a QR code which you can scan in order to go to the website which</p>



<p>I think is also named somewhere at the bottom of this video and it&#8217;ll take you to my main website</p>



<p>where you can just kind of like see all the videos I published and the services and tutorials and</p>



<p>things that I offer and all that good stuff and if you have a suggestion for clarifications or</p>



<p>errata or just future videos that you want to see please leave a comment or if you just want to say</p>



<p>what&#8217;s going on? You know, just send me a comment, whatever. I also wake up for those in the middle</p>



<p>of the night. I get, I wake up in a cold sweat and I&#8217;m like, it would really, it really mean the</p>



<p>world to me. I would really appreciate it. So again, thank you so much for watching this video</p>



<p>and enjoy the cool music as, as I fade into the darkness, which is coming for us all.</p>



<p>Thank you.</p>
<p>The post <a href="https://www.NeuralLantern.com/binary-to-decimal-made-easy-fun-crash-course-for-beginners/">Binary to Decimal Made Easy: Fun Crash Course for Beginners</a> appeared first on <a href="https://www.NeuralLantern.com">NeuralLantern.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.NeuralLantern.com/binary-to-decimal-made-easy-fun-crash-course-for-beginners/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Decimal to Binary Made Easy (Even I Can Do It!)</title>
		<link>https://www.NeuralLantern.com/decimal-to-binary-made-easy-even-i-can-do-it/</link>
					<comments>https://www.NeuralLantern.com/decimal-to-binary-made-easy-even-i-can-do-it/#respond</comments>
		
		<dc:creator><![CDATA[mike]]></dc:creator>
		<pubDate>Sat, 05 Apr 2025 02:53:37 +0000</pubDate>
				<category><![CDATA[Videos]]></category>
		<category><![CDATA[base 10 to base 2]]></category>
		<category><![CDATA[binary conversion]]></category>
		<category><![CDATA[binary numbers explained]]></category>
		<category><![CDATA[binary tutorial]]></category>
		<category><![CDATA[coding fundamentals]]></category>
		<category><![CDATA[computer science basics]]></category>
		<category><![CDATA[decimal binary step by step]]></category>
		<category><![CDATA[decimal to binary]]></category>
		<category><![CDATA[easy math tutorial]]></category>
		<category><![CDATA[how to convert decimal]]></category>
		<category><![CDATA[learn binary]]></category>
		<category><![CDATA[math for beginners]]></category>
		<category><![CDATA[math practice]]></category>
		<category><![CDATA[math tricks]]></category>
		<category><![CDATA[number systems]]></category>
		<guid isPermaLink="false">https://www.NeuralLantern.com/?p=47</guid>

					<description><![CDATA[<p>Hey there! Let’s dive into converting decimal to binary—super simple once you get it! I walk you through 55432 and 632, step-by-step, with a few calculator oopsies (I’m not a&#8230;</p>
<p>The post <a href="https://www.NeuralLantern.com/decimal-to-binary-made-easy-even-i-can-do-it/">Decimal to Binary Made Easy (Even I Can Do It!)</a> appeared first on <a href="https://www.NeuralLantern.com">NeuralLantern.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-embed is-type-wp-embed is-provider-rumble-com wp-block-embed-rumble-com"><div class="wp-block-embed__wrapper">
<iframe loading="lazy" class="wp-embedded-content" sandbox="allow-scripts" security="restricted" title="Decimal to Binary Made Easy (Even I Can Do It!)" src="https://rumble.com/embed/v6phdkh/#?secret=DLvY0RU5yO" data-secret="DLvY0RU5yO" width="1000" height="563" frameborder="0"></iframe>
</div></figure>



<p>Hey there! Let’s dive into converting decimal to binary—super simple once you get it! I walk you through 55432 and 632, step-by-step, with a few calculator oopsies (I’m not a math whiz either). Learn the divide-by-2 trick, why remainders matter, and how to double-check your work. Plus, a pro tip: don’t just memorize—practice tons! Hit subscribe if you liked it, and let’s keep learning together!</p>



<p>Introduction to Decimal and Binary 00:00:00<br>Explaining Base 10 and Base 2 00:00:11<br>Conversion Method Overview 00:01:35<br>Starting Conversion Example (55432) 00:02:20<br>Step-by-Step Division Process 00:02:35<br>Using Modulo Operator 00:02:57<br>Continuing Division Steps 00:04:04<br>Reaching Remainder Patterns 00:05:53<br>Finishing Conversion and Reversing 00:09:17<br>Double-Checking Binary Result 00:11:51<br>Second Example Introduction (632) 00:12:52<br>Conversion Process for 632 00:13:04<br>Correcting Mistakes in Calculation 00:14:22<br>Completing 632 Conversion 00:15:56<br>Learning Tips and Verification 00:16:04<br>Outro and Subscription Request 00:16:40<br>Additional Engagement Options 00:17:41</p>



<p>Thanks for watching!</p>



<p>Find us on other social media here:</p>



<ul class="wp-block-list">
<li>https://www.NeuralLantern.com/social</li>
</ul>



<p>Please help support us!</p>



<ul class="wp-block-list">
<li>Subscribing + Sharing on Social Media</li>



<li>Leaving a comment or suggestion</li>



<li>Subscribing to our Blog</li>



<li>Watching the main &#8220;pinned&#8221; video of this channel for offers and extras</li>
</ul>



<p>Hello there.</p>



<p>Let&#8217;s talk about converting decimal to binary.</p>



<p>So decimal and binary, if you don&#8217;t already know, they&#8217;re number representations with</p>



<p>different bases.</p>



<p>So if we have like a decimal, it&#8217;s base 10, which means we have the character 0, 1, 2,</p>



<p>to represent a number. We could represent the same exact number in binary as long as you&#8217;re</p>



<p>not using like a fraction or anything in binary which is a base 2 because in binary you only have</p>



<p>a 0 and a 1. By the way we can use fractions in binary it&#8217;s just that when you start using</p>



<p>fractions then sometimes the numbers don&#8217;t translate precisely in every single case.</p>



<p>They often do but not always so. If you&#8217;re not using a fraction and you want to convert a number</p>



<p>to binary or binary to decimal it should work you should be able to represent the number exactly</p>



<p>okay so base 10 means we have 10 digits that we can use base 2 means uh two digits or two</p>



<p>sorry two characters or 10 characters and um how do we convert a number okay so the first thing</p>



<p>i&#8217;d like to do is let&#8217;s see five five four three two is what i wanted to do let&#8217;s take a number</p>



<p>And we&#8217;ll convert this number into binary.</p>



<p>So the first thing that we do is we try to understand that every single time we have</p>



<p>a temporary number as we&#8217;re converting from decimal to binary, we&#8217;ll just keep dividing</p>



<p>it by two forever and take the remainder at each step.</p>



<p>The remainder is going to be either zero or one because we divided by two.</p>



<p>When we eventually have nothing left, then we&#8217;re done.</p>



<p>and all of the remainders are going to be the binary number so let&#8217;s try it I&#8217;m</p>



<p>gonna pull up a calculator because I&#8217;m not like super sharp at math all the</p>



<p>time I just want to do this quickly remove from favorites was already in</p>



<p>there oh it&#8217;s right there the symbol doesn&#8217;t make sense the calculate people</p>



<p>have a different symbol and I I&#8217;m doing something wrong it&#8217;s not showing the</p>



<p>right symbol here I need to fix that okay so 554 32 so the first thing we do</p>



<p>So the first thing we do is we divide it by 2, so I&#8217;m going to say 55432, just write down all the steps, it&#8217;s a really, really good idea.</p>



<p>55432 divided by 2 is what? It&#8217;s something, remainder something.</p>



<p>So the remainder is either going to be 0 or 1, so I&#8217;m just going to punch that into the calculator real fast, divided by 2, that&#8217;s going to be 27716.</p>



<p>Well, we started with an even number so I can just infer that the remainder is going to be zero.</p>



<p>But if you&#8217;re not sure, you can use the modulo operator.</p>



<p>So here when we use the division operator, it&#8217;ll tell us what the quotient is.</p>



<p>What&#8217;s the actual, you know, what is that number divided by the other number?</p>



<p>But if we use the modulo operator, it&#8217;ll just give us the remainder.</p>



<p>Not all calculators do this. Keep that in mind.</p>



<p>7 7 1 6 which was the the result and just multiply it by 2 again if you have the same exact number as you started with</p>



<p>Then you know the remainder is 0 otherwise</p>



<p>You can subtract the original number 5 5 4 3 2 from</p>



<p>The number that you multiplied back up and then that should give you the real remainder. Hopefully your calculator does modulo though</p>



<p>For those of you who are ambitious you can probably just open up a Python terminal and</p>



<p>way because programming languages all have the modular operator and python is pretty easy to get</p>



<p>into all right so we&#8217;ve done that we now know that there is a zero somewhere in our binary result</p>



<p>but because we have this result that is pretty big we&#8217;re not done we have to continue dividing</p>



<p>so i&#8217;m just going to take that number copy paste it to the next line and divide it again</p>



<p>and just repeat the process i&#8217;m going to say something divided by two it&#8217;s one three eight</p>



<p>check myself here 13858 the original number was even the six was even so I know there&#8217;s not going</p>



<p>to be a remainder pretty much you know if it&#8217;s even zero remainder if it&#8217;s odd one remainder</p>



<p>that&#8217;s pretty easy I don&#8217;t need to worry about the modulo operator and then I&#8217;m going to do it</p>



<p>again copy paste 13858 down to the next line divided by two equals what</p>



<p>2929 so 6929 remainder what?</p>



<p>858 at the end there was even so I&#8217;m going to say it&#8217;s remainder zero that&#8217;s like a lot of zero remainders for me personally</p>



<p>I like to space</p>



<p>My notepad results here out so that everything is lined up notice how the R is kind of like askew</p>



<p>So I&#8217;m just going to hit a space there to make sure everything is lined up</p>



<p>And then I&#8217;m going to do it again</p>



<p>6929 divided by 2 maybe I&#8217;ll hit a space before that</p>



<p>that division symbol to make sure everything is okay.</p>



<p>6929 is going to be, oops, I&#8217;m on the wrong.</p>



<p>Did I accidentally close that?</p>



<p>Oh my gosh.</p>



<p>I cannot stop myself.</p>



<p>What?</p>



<p>It&#8217;s saying that it was already open somewhere.</p>



<p>Did I just miss that?</p>



<p>No, okay.</p>



<p>Whatever.</p>



<p>Okay.</p>



<p>So 6929 divided by two,</p>



<p>divided by two it&#8217;s going to be oh I forgot yeah this calculator is not going</p>



<p>to like around for me so that&#8217;s that makes it even easier if the result is</p>



<p>0.5 then the remainder is definitely one otherwise the remainder is zero so it&#8217;s</p>



<p>going to be three four six four remainder one three four six four</p>



<p>remainder one space it out real fast three four six four remainder one okay</p>



<p>and then copy three four six four forget about the one we&#8217;re not copying that</p>



<p>copying the actual quotient result. So 3464 divided by 2, 1732, 32, remainder 0 because</p>



<p>it was even in the first place, 1732. Oh, there it is. I keep forgetting. Maybe I should</p>



<p>pin this to the top so I don&#8217;t lose it. 1732 divided by 2, it&#8217;s going to be 866. Whoops,</p>



<p>3 2 divided by 2 equals 8 66 remainder 0 because it was even do my spacing i did my spacing</p>



<p>then we&#8217;ll divide again 866 divided by 2 i don&#8217;t know maybe my spacing is kind of dumb maybe i</p>



<p>should have spaced the numbers and not spaced the operator that&#8217;s probably better okay so 866 divided</p>



<p>433, 433, and it was even, so the remainder is zero.</p>



<p>And then, 433, okay, so 433 divided by two.</p>



<p>I&#8217;m getting tired of this.</p>



<p>I don&#8217;t know if you can tell.</p>



<p>216, so 433 divided by two is going to be equal to 216,</p>



<p>and then remainder one.</p>



<p>Space that out.</p>



<p>Oh, I messed that up again, okay.</p>



<p>And then space those out, and then everything is good.</p>



<p>those out and then everything is good okay so then 216 divided by two and of</p>



<p>course I&#8217;m just doing this again and again and again I hope this is not too</p>



<p>boring but I hope you&#8217;re following along another good tip that I like to give</p>



<p>people when they&#8217;re learning new things is do not make the mistake of</p>



<p>accidentally memorizing a handful of examples try to find as many examples as</p>



<p>you possibly can and every time you practice use a different example that</p>



<p>way you will actually learn how to do the thing instead of accidentally</p>



<p>accidentally memorizing an example. Okay, so 108 divided by two. Maybe I&#8217;ll do this again,</p>



<p>but with a smaller number just to make things faster. It&#8217;s going to be 54,</p>



<p>remainder zero, and then 54 divided by two. I guess I can just do this in my head. I don&#8217;t</p>



<p>really trust myself, so I&#8217;m going to do it over here. Okay, 24 remainder zero, because it was</p>



<p>even and then we&#8217;ll do 27 over here that&#8217;s definitely going to be a remainder one so that&#8217;s</p>



<p>going to be like probably 13 remainder one i don&#8217;t trust myself i&#8217;m gonna do it for real</p>



<p>27 divided by 2 13 remainder 1 and then put the 13 there 13 divided by 2 is</p>



<p>um 6 remainder 1 oh no i&#8217;m losing it okay 6 remainder 1</p>



<p>for double checking. I am honestly not like an internal mind math whiz. And then we do</p>



<p>six divided by two, that&#8217;s just going to be three remainder zero. And then we&#8217;ll do</p>



<p>three divided by two is going to be, you know, one because only one of the twos can fit there.</p>



<p>And then one remainder one. And then we have one left over. So we&#8217;ll say one divided by two,</p>



<p>we can&#8217;t actually fit, you know, any twos into the one. So it&#8217;s going to be zero.</p>



<p>so it&#8217;s going to be zero remainder one and now at this point remember we&#8217;re just carrying over</p>



<p>the quotient result we&#8217;re not carrying over the remainder so if I carry this over here</p>



<p>zero divided by two the number is always going to just be zero remainder zero no matter how many</p>



<p>times now no matter how many times we carry this down so we know we&#8217;re done when this number that</p>



<p>we&#8217;re dividing is a zero we&#8217;re just totally finished so now I&#8217;m just going to omit that</p>



<p>Well, maybe I&#8217;ll leave one up there just to kind of prove a point.</p>



<p>Think about this, if this is actually going to be zeros forever, which side of the number</p>



<p>string would the zeros go on so that no matter how many zeros you computed, the actual result</p>



<p>wouldn&#8217;t change?</p>



<p>For example, if I had this original decimal number and I decided to say, all right, I&#8217;m</p>



<p>going to add some zeros to it without changing the result.</p>



<p>then it definitely changes what number that is, right?</p>



<p>The value is now multiplied by a thousand.</p>



<p>But if I put the zeros on the left,</p>



<p>then the number doesn&#8217;t actually change.</p>



<p>These are junk zeros.</p>



<p>They don&#8217;t mean anything or they mean nothing.</p>



<p>So that means wherever the endless zeros are</p>



<p>is actually the left side of the binary string</p>



<p>that you&#8217;re trying to make.</p>



<p>Think about it.</p>



<p>You know, we&#8217;re not going to put a bunch of zeros</p>



<p>on the right side of a binary string</p>



<p>we&#8217;d be increasing the size dramatically just based on our whims of how many times we tried</p>



<p>to divide a zero.</p>



<p>Instead if we stick the numbers on the left side, then the result doesn&#8217;t change so it&#8217;s</p>



<p>totally fine.</p>



<p>Which means if you kind of tilt your head to the left, that&#8217;s the number, not to the</p>



<p>right.</p>



<p>So that means you know probably intuitively you might have been thinking oh the first</p>



<p>number, the first remainder we got that was going to be the first digit and then we work</p>



<p>our way to the right.</p>



<p>we work our way to the right no no no actually it&#8217;s backwards we have to reverse it so i&#8217;m going</p>



<p>to go ahead and um you know you can you can if you want to you know you can start at the bottom</p>



<p>and work your way up and then just write the binary string correctly sometimes i&#8217;d like to</p>



<p>start from the top and then reverse the string later just as a little brain exercise so i&#8217;ll go</p>



<p>one two three starting from the top one one two three one one two three one one zero one one</p>



<p>And then I&#8217;ll reverse it.</p>



<p>I&#8217;ll say 1101100010001000.</p>



<p>And because I just did it this way, this provides a nice opportunity to double check your work</p>



<p>because it&#8217;s really easy to get things like this wrong.</p>



<p>I get things wrong all the time.</p>



<p>And so if you can figure out a way to double check your work in two or three different ways,</p>



<p>you reduce the chances of being wrong.</p>



<p>It takes a little more time, but it&#8217;s a really good idea when you&#8217;re actually doing work</p>



<p>or like you&#8217;re taking an exam or whatever.</p>



<p>an exam or whatever check your work in multiple different ways so now that I&#8217;ve done it in</p>



<p>the first way I&#8217;m going to do it from the bottom up just to see if I was right so I&#8217;m</p>



<p>going to go one one zero one one zero zero zero one zero zero zero one zero zero zero</p>



<p>does it match it seems to match so I&#8217;m pretty confident that this is the correct number let&#8217;s</p>



<p>just punch it in real fast I&#8217;m going to punch it in on my personal calculator here real</p>



<p>I&#8217;m just going to copy this to my outside calculator just to prove to myself that it works.</p>



<p>55432.</p>



<p>Okay, so this is indeed the correct answer.</p>



<p>We now understand how to convert from decimal to binary.</p>



<p>It&#8217;s not too bad, right?</p>



<p>Let&#8217;s do another number just for fun, just something really small.</p>



<p>Let&#8217;s go 632.</p>



<p>Okay, whoops, nope, nope, nope.</p>



<p>Let&#8217;s do another tab.</p>



<p>We&#8217;ll say decimal 632 so that this is faster.</p>



<p>We start with 632.</p>



<p>We divide it by 2.</p>



<p>632 we divide it by 2 the result is going to be oh can I guess this 350 and then like a 15 and then</p>



<p>a one one I don&#8217;t know if that&#8217;s going to be right remainder zero let me see if I can punch this up</p>



<p>632 divided by zero I oh I blew it oh I was thinking of okay this is why I use a calculator</p>



<p>316 divided by 2 is going to be, I thought I was so cool too, like, oh, everyone watching</p>



<p>is going to be so impressed that I did this in my mind.</p>



<p>Nope.</p>



<p>So we do 316 divided by 2, it&#8217;s going to be 158 remainder 0.</p>



<p>So 158 divided by 2, that&#8217;s going to be, okay, that&#8217;s 75 plus 4, I guarantee it.</p>



<p>So I&#8217;m going to do 79, 79 remainder 0.</p>



<p>Let me see if I&#8217;m right.</p>



<p>Oh gosh, this is going to be embarrassing if I get it wrong.</p>



<p>79, okay.</p>



<p>So then, now we&#8217;re gonna do 79 divided by two.</p>



<p>Whoops, I spaced poorly.</p>



<p>79 divided by two is basically gonna be 39 remainder one.</p>



<p>We know it&#8217;s remainder one,</p>



<p>cause you know, 79 is odd.</p>



<p>If it was 80 divided by two, it would&#8217;ve been 40.</p>



<p>So let&#8217;s just double check real fast</p>



<p>to make sure that we&#8217;re getting it right.</p>



<p>It&#8217;s easy to get things wrong</p>



<p>if you&#8217;re not double checking yourself.</p>



<p>39, okay, so then we&#8217;ll do 39 divided by two.</p>



<p>divided by 2</p>



<p>well that&#8217;s just going to be 20 remainder 1</p>



<p>am I right about that? I don&#8217;t know</p>



<p>let&#8217;s see</p>



<p>39 divided by 2</p>



<p>oh I blew it</p>



<p>what was I thinking?</p>



<p>of course it&#8217;s going to be at least 40 if it&#8217;s 20</p>



<p>totally blew it</p>



<p>so 19 divided by 2</p>



<p>ok so I&#8217;m looking for a lower number not a higher number</p>



<p>so 18 so that&#8217;s 9</p>



<p>let me see 9 remainder 1</p>



<p>am I right?</p>



<p>Am I right? By the way all these shenanigans that I&#8217;m doing right now are exactly how I&#8217;m gonna end up with the wrong result</p>



<p>And have to do this whole thing all over again from scratch, but hey at least it will be more brain exercise</p>



<p>Okay, so 9 divided by 2</p>



<p>I&#8217;m gonna say 4 remainder 1 because it&#8217;s odd</p>



<p>We&#8217;ll do 9 divided by 2 just to double check and then we&#8217;ll say 4 divided by 2 is</p>



<p>think I need to double check it although I probably should anyway 2 divided by 2 is going to be 1</p>



<p>remainder 0 okay we have a 1 so we actually have to do this one more step 1 divided by 2 equals</p>



<p>1 remainder 0 oh sorry sorry sorry sorry 0 remainder 0 otherwise that would have been</p>



<p>infinity 1s for no reason at all so 0 remainder 0 sorry remainder 1</p>



<p>Then finally, we&#8217;re down to 0 divided by 2 equals just 0, remainder 0.</p>



<p>And then we&#8217;re finished.</p>



<p>Okay.</p>



<p>Let me do it the first way where I go from top to bottom, then reverse it.</p>



<p>1, 2, 3, 1, 2, 3, 4, 1, 2, 1, 1, 2, 3, 4.</p>



<p>Then I&#8217;ll try to reverse that.</p>



<p>1, 2, 3, 4, 1, 1, 2, 1, 2, 3, 4, 1, 2, 3.</p>



<p>Okay.</p>



<p>Then I&#8217;ll do it from the bottom up.</p>



<p>1, 2, 3, 4, 1, 0, 0, 1, 2, 3, 4, 1, 2, 3.</p>



<p>two, three, do these two match?</p>



<p>Yes, they do.</p>



<p>Okay, I think we&#8217;ve successfully done this.</p>



<p>We&#8217;re now semi-experts at converting decimal to binary.</p>



<p>Thank you for watching.</p>



<p>I hope you enjoyed this video.</p>



<p>I hope you learned a little bit of stuff and had a little bit of fun.</p>



<p>I&#8217;ll see you in the next video.</p>



<p>Hey, everybody.</p>



<p>Thanks for watching this video again from the bottom of my heart.</p>



<p>I really appreciate it.</p>



<p>I do hope you did learn something and have some fun.</p>



<p>If you could do me a please a small little favor</p>



<p>Could you please subscribe and follow this channel or these videos or whatever it is you do on the current social media?</p>



<p>It&#8217;s a website that you&#8217;re looking at right now</p>



<p>It would really mean the world to me and it&#8217;ll help make more videos and grow this community</p>



<p>So we&#8217;ll be able to do more videos longer videos better videos or just I&#8217;ll be able to keep making videos in general</p>



<p>So please do do me a kindness and and subscribe</p>



<p>in the middle of the night and I just wake up because I know somebody</p>



<p>subscribed or followed it just wakes me up and I get filled with joy that&#8217;s</p>



<p>exactly what happens every single time so you could do it as a nice favor to me</p>



<p>or you could you control me if you want to just wake me up in the middle of</p>



<p>night just subscribe and then I&#8217;ll just wake up I promise that&#8217;s what will</p>



<p>happen also if you look at the middle of the screen right now you should see a</p>



<p>QR code which you can scan in order to go to the website which I think is also</p>



<p>named somewhere at the bottom of this video and it&#8217;ll take you to my main</p>



<p>take you to my main website where you can just kind of like see all the videos I published and</p>



<p>the services and tutorials and things that I offer and all that good stuff and</p>



<p>if you have a suggestion for clarifications or errata or just future videos that you want to</p>



<p>see please leave a comment or if you just want to say hey what&#8217;s up what&#8217;s going on you know</p>



<p>just send me a comment whatever I also wake up for those in the middle of the night I get</p>



<p>it would really it really mean the world to me I would really appreciate it so</p>



<p>again thank you so much for watching this video and enjoy the cool music as</p>



<p>as I fade into the darkness which is coming for us all</p>



<p>Thank you.</p>



<p></p>
<p>The post <a href="https://www.NeuralLantern.com/decimal-to-binary-made-easy-even-i-can-do-it/">Decimal to Binary Made Easy (Even I Can Do It!)</a> appeared first on <a href="https://www.NeuralLantern.com">NeuralLantern.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.NeuralLantern.com/decimal-to-binary-made-easy-even-i-can-do-it/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Master Number Bases: Decimal, Binary, and Hexadecimal Explained!</title>
		<link>https://www.NeuralLantern.com/master-number-bases-decimal-binary-and-hexadecimal-explained/</link>
					<comments>https://www.NeuralLantern.com/master-number-bases-decimal-binary-and-hexadecimal-explained/#respond</comments>
		
		<dc:creator><![CDATA[mike]]></dc:creator>
		<pubDate>Thu, 03 Apr 2025 13:34:59 +0000</pubDate>
				<category><![CDATA[Videos]]></category>
		<category><![CDATA[0b prefix]]></category>
		<category><![CDATA[0x prefix]]></category>
		<category><![CDATA[base 10]]></category>
		<category><![CDATA[base 16]]></category>
		<category><![CDATA[base 2]]></category>
		<category><![CDATA[binary explained]]></category>
		<category><![CDATA[binary numbers]]></category>
		<category><![CDATA[coding for beginners]]></category>
		<category><![CDATA[computer science basics]]></category>
		<category><![CDATA[decimal to binary]]></category>
		<category><![CDATA[geeky tutorials]]></category>
		<category><![CDATA[hex vs binary]]></category>
		<category><![CDATA[hexadecimal numbers]]></category>
		<category><![CDATA[hexadecimal tutorial]]></category>
		<category><![CDATA[how computers work]]></category>
		<category><![CDATA[learn binary]]></category>
		<category><![CDATA[number bases]]></category>
		<category><![CDATA[number systems]]></category>
		<category><![CDATA[programming tips]]></category>
		<category><![CDATA[tech education]]></category>
		<guid isPermaLink="false">https://www.NeuralLantern.com/?p=43</guid>

					<description><![CDATA[<p>Hello there! Ever wondered what number bases are all about? In this video, we?re diving into decimal (base 10 &#8211; the one you already know), binary (base 2 &#8211; just&#8230;</p>
<p>The post <a href="https://www.NeuralLantern.com/master-number-bases-decimal-binary-and-hexadecimal-explained/">Master Number Bases: Decimal, Binary, and Hexadecimal Explained!</a> appeared first on <a href="https://www.NeuralLantern.com">NeuralLantern.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-embed is-type-wp-embed is-provider-rumble-com wp-block-embed-rumble-com"><div class="wp-block-embed__wrapper">
<iframe loading="lazy" class="wp-embedded-content" sandbox="allow-scripts" security="restricted" title="Master Number Bases: Decimal, Binary, and Hexadecimal Explained!" src="https://rumble.com/embed/v6pe6ux/#?secret=olHl5zk87A" data-secret="olHl5zk87A" width="1000" height="563" frameborder="0"></iframe>
</div></figure>



<p>Hello there! Ever wondered what number bases are all about? In this video, we?re diving into decimal (base 10 &#8211; the one you already know), binary (base 2 &#8211; just 1s and 0s, how your computer thinks), and hexadecimal (base 16 &#8211; the compact cool kid). I?ll show you how the same number looks totally different across these systems &#8211; binary gets LONG, hex keeps it short and sweet. Plus, why do we even use hex? Spoiler: it?s a game-changer for reading computer memory. Stick around to learn handy prefixes like 0x and 0b to avoid mix-ups. Want to be as cool as those binary-converting pros? Hit subscribe, scan the QR code for more, and let?s geek out together in the next video &#8211; conversions are coming up! Drop a comment with your thoughts or just say hi &#8211; it might wake me up in the middle of the night with joy! </p>



<p>Please help support us!</p>



<ul class="wp-block-list">
<li>Subscribing + Sharing on Social Media</li>



<li>Leaving a comment or suggestion</li>



<li>Subscribing to our Blog</li>



<li>Watching the main &#8220;pinned&#8221; video of this channel for offers and extras</li>
</ul>



<p>Hello there. Let&#8217;s talk about number bases. So what are number bases? You&#8217;ve probably at some</p>



<p>point heard someone say, hey, I can convert between decimal and binary or between decimal</p>



<p>and hexadecimal or hexadecimal and binary. And you thought that that person was way cooler than you</p>



<p>were. Well, they are way cooler than you. But if you watch my videos, maybe you can be just as cool</p>



<p>Anyway, so what do we mean by number basis exactly?</p>



<p>We&#8217;ll start with decimal,</p>



<p>which is the number system that everybody already understands, I hope.</p>



<p>So in decimal, you have 10 characters, right?</p>



<p>So we&#8217;ll say like 0, 1, 2, 3, 4, 5, 6, 7, 8, 9.</p>



<p>It&#8217;s like 9, or sorry, 10 possible characters.</p>



<p>So decimal is actually base 10.</p>



<p>I&#8217;m going to write base 10 here.</p>



<p>Decimal is base 10.</p>



<p>base 10 because it has 10 available characters. The next thing is binary. You&#8217;ve probably heard</p>



<p>of that before. Even a lot of non-computer scientists understand binary at least a little</p>



<p>bit because it&#8217;s just ones and zeros, right? This is how your computer represents information.</p>



<p>All characters, all numbers, all floats, all everything. They really just come down to zeros</p>



<p>and ones inside of the computer. And it&#8217;s not like there&#8217;s an actual zero or an actual one anywhere.</p>



<p>It&#8217;s more like there&#8217;s a certain voltage that represents a one or there&#8217;s a different voltage</p>



<p>represents a 1 or there&#8217;s a different voltage that represents a 0.</p>



<p>You can think of it as just like voltage or no voltage, but that&#8217;s not always the case.</p>



<p>But you know, long story short, it&#8217;s just 1s and 0s.</p>



<p>So in binary, we can just represent a 0 or we can represent a 1 and that&#8217;s it.</p>



<p>Because there&#8217;s only two characters that we can use to represent numbers, we call this</p>



<p>base 2.</p>



<p>So that&#8217;s binary.</p>



<p>Now not a lot of people have heard of hexadecimal outside of computer science, but hexadecimal</p>



<p>outside of computer science but hexadecimal is a number is another</p>



<p>number system that we can use which uses base 16 the reason we use hexadecimal is</p>



<p>it because it kind of it kind of compacts a number I&#8217;ll show you in a</p>



<p>second how it can represent the same number but with less characters you can</p>



<p>imagine in binary if we have base 2 there&#8217;s only two characters that means</p>



<p>the same number in decimal versus binary it&#8217;s probably going to be a lot longer</p>



<p>imagine that, right?</p>



<p>Because it&#8217;s not like the actual numbers change</p>



<p>that we&#8217;re trying to represent.</p>



<p>It&#8217;s just that the representation changes.</p>



<p>So hex or hexadecimal,</p>



<p>we have 16 different characters.</p>



<p>Did I say 15 a moment ago?</p>



<p>Sorry if I did.</p>



<p>So we start with the normal ones that base 10 has,</p>



<p>decimal has.</p>



<p>So we go three, four, five, six, seven, eight, nine.</p>



<p>So that&#8217;s 10.</p>



<p>the extra five, we do A, B, C, D, E, F. Sorry, extra six. I knew I was going to say five at some</p>



<p>point. So in hexadecimal, we have the characters zero, one, two, three, four, five, six, seven,</p>



<p>eight, nine, and then A, B, C, D, E, F. For a total of 16 characters, or one digit can represent</p>



<p>here. So this is the basics of the differences between the number systems. Let me show you a</p>



<p>quick example. Let me see if I got my calculator here. Hopefully it&#8217;ll work. Okay. I&#8217;m going to do,</p>



<p>let&#8217;s see, variables. So how do you get into this one? Mode. Oh, number base. So I&#8217;m going to do,</p>



<p>let&#8217;s just pick a random number in decimal. So I&#8217;m going to say like, you know, just hit the</p>



<p>So you can see that if I type a number in decimal and show it in decimal, then well,</p>



<p>it&#8217;s the exact same size as you probably have suspected.</p>



<p>But if I represent this exact same number in binary, you should probably expect that</p>



<p>the representation is going to be way longer because again, binary only has two characters</p>



<p>to work with.</p>



<p>So it&#8217;s harder for it to represent the same information.</p>



<p>So I&#8217;m going to change the expression base here to binary.</p>



<p>Oh no, what&#8217;s happening?</p>



<p>What&#8217;s going on here?</p>



<p>Expression base.</p>



<p>Oh, I did the wrong thing.</p>



<p>Decimal is the expression base.</p>



<p>Binary is the result base.</p>



<p>Okay.</p>



<p>So that same number that we had before, 871, 876, 42,</p>



<p>look at how huge it is in binary.</p>



<p>Takes up a lot of your screen, right?</p>



<p>So we use binary because it&#8217;s the closest representation</p>



<p>to what the actual machine has.</p>



<p>So that&#8217;s good.</p>



<p>Especially if you want to start manipulating individual bits</p>



<p>manipulating individual bits for one reason or another. It&#8217;s good to know how to, it&#8217;s good to</p>



<p>understand binary. But hexadecimal is useful, like I said before, to compact the same number. So</p>



<p>again, because the base of the original number is 10, you know, we had the original number in decimal.</p>



<p>If we show a hexadecimal version of it, it should be shorter because there&#8217;s 16 characters to work</p>



<p>with. It&#8217;s easier for it to represent the same information. So the result base, I&#8217;m just going</p>



<p>hexadecimal here and look at how short that number is the original number is one two three four five</p>



<p>six seven eight it&#8217;s eight characters long but the hexadecimal number is two four six seven</p>



<p>characters long and that savings in characters will go up and up and up the more you know the</p>



<p>longer the original or the bigger the original number is let me see if I can just add some more</p>



<p>numbers here okay let&#8217;s see if we get more savings here one two three four five six seven eight nine</p>



<p>Okay, so the original number is 15 long and here we have 2, 4, 6, 8, 10, 12, 13.</p>



<p>So that&#8217;s a savings.</p>



<p>Now think about it this way.</p>



<p>This is a huge savings compared to binary.</p>



<p>Let&#8217;s go back to binary real fast.</p>



<p>Same number, which is currently in hex.</p>



<p>As soon as I start showing it in binary, the number explodes.</p>



<p>So there are a lot of numbers, especially if you have a 64-bit number, which you work</p>



<p>if you were to just take you know one of those 64-bit numbers and try to express it in binary</p>



<p>it&#8217;s just kind of like it&#8217;s really really long and if you want to represent anything even a little</p>



<p>bit bigger like 128-bit numbers or even the contents of memory from you know one memory</p>



<p>location to another binaries just can explode and fly off the screen so this is why I mean this is</p>



<p>one of the biggest reasons why we use hexadecimal because it&#8217;s just it&#8217;s easier to see what&#8217;s inside</p>



<p>of the computer it&#8217;s easier than decimal and it&#8217;s easier than binary at least once you understand</p>



<p>hexadecimal one other thing that i want to uh show you real fast let me see like let me change</p>



<p>that back to decimal so i don&#8217;t screw myself later okay um suppose that you wanted to represent a</p>



<p>number in binary sorry let&#8217;s say decimal well you know we&#8217;ll say like one two three four right and</p>



<p>well actually let&#8217;s not do one two three four let&#8217;s say like a thousand and one and then you</p>



<p>want to represent a number in binary and you write one zero zero one and then you want to</p>



<p>represent a number in hexadecimal you could also have one zero zero one right the problem is that</p>



<p>each of these numbers are actually different numbers they only look the same because the</p>



<p>character representation is the same but not the actual number so how do you uh how do you sort of</p>



<p>How do you sort of like differentiate and make sure that the person reading the numbers that you&#8217;ve written down knows what base they&#8217;re in?</p>



<p>Because if you know if you&#8217;re a computer scientist or you&#8217;re doing some kind of crazy math, then</p>



<p>well, it might not be obvious and</p>



<p>you want to be careful that the person doesn&#8217;t misinterpret your results.</p>



<p>Okay, so let me do that thing again real fast</p>



<p>just to prove to you. What am I doing here? Units? No.</p>



<p>Mode.</p>



<p>Okay, so I&#8217;m going to say if I write 1001, I&#8217;m going to display it as decimal,</p>



<p>but the input is first going to be decimal.</p>



<p>So in decimal, 1001 is 1001.</p>



<p>Okay, that&#8217;s fine.</p>



<p>But if this 1001 was actually a binary number,</p>



<p>I&#8217;m going to say that the expression base is binary here.</p>



<p>Notice how the real number is actually 9 if you represented it in decimal.</p>



<p>expression like the original number was you know the characters were hexadecimal then the real</p>



<p>decimal version of 1001 would be 4097 that&#8217;s three totally different numbers so you got to be careful</p>



<p>that you know what you&#8217;re reading and you got to be careful that you help the person reading what</p>



<p>you&#8217;re writing down if you&#8217;re trying to transmit this information so with hexadecimal a really</p>



<p>really common prefix that everyone should use is ox ox and then any number after that usually just</p>



<p>reading this is a hexadecimal number so there&#8217;s no ambiguity same thing for binary you&#8217;ll just say</p>



<p>like ob and then for decimal you just just leave it alone i think there&#8217;s a another prefix you can</p>



<p>use but i usually don&#8217;t use anything but at least uh ob says this is binary and ox means this is</p>



<p>hexadecimal and then nothing just means okay just default to human reading just decimal</p>



<p>okay this was the basics of number bases in other videos i&#8217;m going to talk about how to actually</p>



<p>between these three bases maybe in the future at some other point in some other</p>



<p>video far off in YouTube land I might talk about octal or some other base but</p>



<p>in the immediate future it&#8217;s going to be decimal binary and hexadecimal so I</p>



<p>hope you&#8217;ve enjoyed this video I&#8217;ll see you in the next</p>



<p>hey everybody thanks for watching this video again from the bottom of my heart</p>



<p>I really appreciate it I do hope you did learn something and have some fun if you</p>



<p>a small little favor could you please subscribe and follow this channel or</p>



<p>these videos or whatever it is you do on the current social media website that</p>



<p>you&#8217;re looking at right now it would really mean the world to me and it&#8217;ll</p>



<p>help make more videos and grow this community so we&#8217;ll be able to do more</p>



<p>videos longer videos better videos or just I&#8217;ll be able to keep making videos</p>



<p>in general so please do do me a kindness and and subscribe you know sometimes</p>



<p>I&#8217;m sleeping in the middle of the night and I just wake up because I know</p>



<p>wake up because I know somebody subscribed or followed. It just wakes me up and I get filled</p>



<p>with joy. That&#8217;s exactly what happens every single time. So you could do it as a nice favor to me or</p>



<p>you could you could troll me if you want to just wake me up in the middle of the night just</p>



<p>subscribe and then I&#8217;ll just wake up. I promise that&#8217;s what will happen. Also if you look at the</p>



<p>middle of the screen right now you should see a QR code which you can scan in order to go to the</p>



<p>website which I think is also named somewhere at the bottom of this video and it&#8217;ll take you to my</p>



<p>You can just kind of like see all the videos I published and the services and tutorials and things that I offer and all that good stuff.</p>



<p>And if you have a suggestion for clarifications or errata or just future videos that you want to see, please leave a comment.</p>



<p>Or if you just want to say, hey, what&#8217;s up? What&#8217;s going on? You know, just send me a comment, whatever.</p>



<p>I also wake up for those in the middle of the night. I wake up in a cold sweat and I&#8217;m like,</p>



<p>It would really mean the world to me.</p>



<p>I would really appreciate it.</p>



<p>So again, thank you so much for watching this video.</p>



<p>And enjoy the cool music as I fade into the darkness, which is coming for us all.</p>



<p>Thank you.</p>
<p>The post <a href="https://www.NeuralLantern.com/master-number-bases-decimal-binary-and-hexadecimal-explained/">Master Number Bases: Decimal, Binary, and Hexadecimal Explained!</a> appeared first on <a href="https://www.NeuralLantern.com">NeuralLantern.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.NeuralLantern.com/master-number-bases-decimal-binary-and-hexadecimal-explained/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
