Jump to content




Binary and Computer Logics


  • You cannot reply to this topic
33 replies to this topic

#1 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 03 May 2013 - 01:18 PM

Ok firstly I would like to apologise if any of this is too high level. I will go through it in the near future and definitely try to simplify it more if required.

EDIT: Oh also if you're wondering what this had to do with ComputerCraft, that is coming in the next instalment with Bit Operations, knowing binary and logics is essential to understanding it, but I can't finish this tonight, too tired, need sleep.

Data Representation

Modern technology are all digital devices, i.e. they work with binary (0 and 1). Before a computer can precess data, it has to be represented in binary.

Some terminology...
Spoiler

Natural Numbers (Base-10)
Spoiler

Binary numbers (Base-2)
Spoiler

A bit more about base numbers
Spoiler

Binary Arithmetic
Spoiler

Negative Numbers
Spoiler

Boolean Algebra/Logic
Spoiler

Bit Operations
Spoiler

Thank you for reading... Feel free to leave a comment or send me a PM if you're still not quite understanding and I will attempt to help you understand better and also (if required) update this post to reflect accordingly...

Edited by theoriginalbit, 04 May 2013 - 10:30 PM.


#2 superaxander

  • Members
  • 609 posts
  • LocationHolland

Posted 03 May 2013 - 01:58 PM

This helped me a lot with understanding binary thanks!

#3 Mads

  • Members
  • 604 posts
  • LocationCopenhagen, Denmark

Posted 03 May 2013 - 02:14 PM

This is a good tutorial, but it doesn't really explain how to use the basic logic gates for arithmetic etc.

#4 Dlcruz129

    What's a Lua?

  • Members
  • 1,423 posts

Posted 03 May 2013 - 07:44 PM

Awesome! All I knew about binary was counting until now.

#5 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 04 May 2013 - 02:03 AM

View Postsuperaxander, on 03 May 2013 - 01:58 PM, said:

This helped me a lot with understanding binary thanks!

View PostDlcruz129, on 03 May 2013 - 07:44 PM, said:

Awesome! All I knew about binary was counting until now.
Cool. I'm glad your learnt something.

View PostMads, on 03 May 2013 - 02:14 PM, said:

This is a good tutorial, but it doesn't really explain how to use the basic logic gates for arithmetic etc.
Thanks for the feedback, I was too tired to finish it last night but I was planning on revisiting arithmetic after the boolean algebra.

#6 InputUsername

  • Members
  • 231 posts
  • LocationThe Netherlands

Posted 04 May 2013 - 04:13 AM

Thanks! I now understand binary :D Also great you explained some hexadecimal too.

#7 M4sh3dP0t4t03

  • Members
  • 255 posts
  • LocationGermany

Posted 04 May 2013 - 04:33 AM

Great tutorial even if its not exactly related to computercraft. I have known how binary works but it seems like a nice tutorial for beginners.
Edit: I'm currently working on a little API for converting numbers between binary, decimal and hexadecimal but I'm not sure if I should release it

#8 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 04 May 2013 - 10:33 AM

View PostKingOfNoobs, on 04 May 2013 - 04:33 AM, said:

Great tutorial even if its not exactly related to computercraft.
Not yet, didn't you read the edit :P

View PostKingOfNoobs, on 04 May 2013 - 04:33 AM, said:

it seems like a nice tutorial for beginners.
That's what I was aiming it for :) I based it all off my knowledge but the format and flow inspiration came from the Computer Logics and Essentials class I had to take at university, because sadly I could not provide professional evidence of knowledge in binary to get it exempted :(

#9 Orwell

    Self-Destructive

  • Members
  • 1,091 posts

Posted 04 May 2013 - 11:38 AM

This is a good tutorial, I believe it's written in an educative manner. I have a few suggestions that you could add that are still not too high level and useful. You could cover the rules of precedence of logical operators. Also, covering the setting (and not), resetting (or), toggling (xor) and checking (and) of bits could give some insight in the practical usage of the logical operators. You could also give De Morgan's laws as this helps with simplifying boolean expressions.

#10 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 04 May 2013 - 12:00 PM

View PostOrwell, on 04 May 2013 - 11:38 AM, said:

This is a good tutorial, I believe it's written in an educative manner.
Thank you. :) It was what I was aiming for :)

View PostOrwell, on 04 May 2013 - 11:38 AM, said:

You could also give De Morgan's laws as this helps with simplifying boolean expressions.
Yeh I was considering this, but I was afraid that it was going to be too high level and/or confusing for most people.

#11 Pharap

  • Members
  • 816 posts
  • LocationEngland

Posted 04 May 2013 - 12:06 PM

Good to see another binary tutorial. That makes 2 lol.

I think yours was a lot less wordy than mine.

#12 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 04 May 2013 - 12:48 PM

View PostPharap, on 04 May 2013 - 12:06 PM, said:

Good to see another binary tutorial. That makes 2 lol.
Would you believe that I planned on doing this when you did yours :P ... yes it has taken me this long to get around to it ;)

View PostPharap, on 04 May 2013 - 12:06 PM, said:

I think yours was a lot less wordy than mine.
Yeh I was/am trying to provide the content in a way that doesn't overload the reader with big and technical terms, but instead provide it in an easy to understand manner.

#13 diegodan1893

  • Members
  • 164 posts
  • LocationSpain

Posted 04 May 2013 - 03:02 PM

Nice tutorial, but I think you made a mistake, in binary addition, you said 1+0=0

#14 Pharap

  • Members
  • 816 posts
  • LocationEngland

Posted 04 May 2013 - 03:28 PM

View Posttheoriginalbit, on 04 May 2013 - 12:48 PM, said:

View PostPharap, on 04 May 2013 - 12:06 PM, said:

Good to see another binary tutorial. That makes 2 lol.
Would you believe that I planned on doing this when you did yours :P ... yes it has taken me this long to get around to it ;)

View PostPharap, on 04 May 2013 - 12:06 PM, said:

I think yours was a lot less wordy than mine.
Yeh I was/am trying to provide the content in a way that doesn't overload the reader with big and technical terms, but instead provide it in an easy to understand manner.

In mine I was just trying to be as thorough as possible.

#15 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 04 May 2013 - 10:30 PM

View Postdiegodan1893, on 04 May 2013 - 03:02 PM, said:

Nice tutorial, but I think you made a mistake, in binary addition, you said 1+0=0
Ah yes, thank you for picking that up. It was really late when I wrote that particular section.

View PostPharap, on 04 May 2013 - 03:28 PM, said:

In mine I was just trying to be as thorough as possible.
You can be thorough while not being over technical though. Which is what I am aiming to do.

#16 Symmetryc

  • Members
  • 434 posts

Posted 05 May 2013 - 09:30 AM

I didn't read the whole thing yet, but really nice tutorial! You might want to explain how to convert from any base to any base, though rather than providing only examples for specific bases.

#17 Mads

  • Members
  • 604 posts
  • LocationCopenhagen, Denmark

Posted 05 May 2013 - 12:49 PM

View PostSymmetryc, on 05 May 2013 - 09:30 AM, said:

I didn't read the whole thing yet, but really nice tutorial! You might want to explain how to convert from any base to any base, though rather than providing only examples for specific bases.

The same rules apply to every numeral system you can imagine.

#18 Symmetryc

  • Members
  • 434 posts

Posted 05 May 2013 - 03:02 PM

View PostMads, on 05 May 2013 - 12:49 PM, said:

View PostSymmetryc, on 05 May 2013 - 09:30 AM, said:

I didn't read the whole thing yet, but really nice tutorial! You might want to explain how to convert from any base to any base, though rather than providing only examples for specific bases.

The same rules apply to every numeral system you can imagine.
I'm not talking about the nature of the bases, I'm talking about converting the bases from one base to another :P. But I guess it's not very good to implement because it might confuse the viewer if they're a beginner.

#19 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 05 May 2013 - 03:19 PM

View PostSymmetryc, on 05 May 2013 - 03:02 PM, said:

I'm not talking about the nature of the bases, I'm talking about converting the bases from one base to another :P. But I guess it's not very good to implement because it might confuse the viewer if they're a beginner.
well I think it wouldn't be too confusing to the beginner if I detailed the long and lazy way (the way I actually do it, since most my math I do in my head and this way is easier, and I'm generally very lazy)
<source-base> —> <base-10> —> <target-base>

#20 Engineer

  • Members
  • 1,378 posts
  • LocationThe Netherlands

Posted 05 May 2013 - 04:28 PM

This saves you a lot on time on skype ^_^





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users