Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Professor Fiel on Binary and Hex
#21
That was a really fun read.
Reply
#22
*read a third the way through htm doc*
*walks away hopelessly confused*
Reply
#23
Can't wait for the next session, Fiel. I feel like I learned a lot. Made a lot of stupid mistakes. I need some practice problems.

Using this I made a code, sortof. I represented all the letters of the alphabet as numbers, logically 1-26. I then used hexadecimal to represent the numbers and dropped the 0x prefixes which made it look like normal hex to me. Honestly, I have no idea what I am tlaking about but w/e. For example a was 1 or 0000 0001 or 01 and Z was 26 or 0001 1010 or 1A. I then used 00 to represent a space. Here are some phrases I wrote:

0D 01 14 14 00 09 13 00 03 0F 0F 0C
M..A...T..T.......I...S.......C..O..O..L

&

0A A5 13 14 00 10 12 01 03 14 09 03 05
J...U...S..T.......P...R..A..C..T...I...C...E
Reply
#24
Wow, I really liked reading through the chat log. Most of it is (really good) review for me, but I did learn a few things. I didn't know that cryptology uses simple bit operations, but then again, I did make this buggy thing last year.

Will you be going over signed integers and 2's complement? Representation of floats and double floats and how they are approximately stored?
Reply
#25
Well, it'd be a bit tough to go over all of binary arithmetic, but I guess it could be done.

TehMatt Wrote:Can't wait for the next session, Fiel. I feel like I learned a lot. Made a lot of stupid mistakes. I need some practice problems.

Using this I made a code, sortof. I represented all the letters of the alphabet as numbers, logically 1-26. I then used hexadecimal to represent the numbers and dropped the 0x prefixes which made it look like normal hex to me. Honestly, I have no idea what I am tlaking about but w/e. For example a was 1 or 0000 0001 or 01 and Z was 26 or 0001 1010 or 1A. I then used 00 to represent a space. Here are some phrases I wrote:

0D 01 14 14 00 09 13 00 03 0F 0F 0C
M..A...T..T.......I...S.......C..O..O..L

&

0A A5 13 14 00 10 12 01 03 14 09 03 05
J...U...S..T.......P...R..A..C..T...I...C...E

In line of keeping with how programming languages work, using "00" as a space would not be the best. Why? Because all strings in programming languages end with a null terminator.

So if the string were just "MATT", the computer would see the letters "M", "A", "T", "T", and then a null terminator ("\0") to signify the end of the string.

So what is used otherwise?

There's something called the ASCII table. This table ascribes a number with every possible strike on the keyboard. So when you type the letter "A", on the keyboard, the computer reads 65 (0x41) and prints that to the screen. You'll notice on the ASCII table that there is a value that corresponds with hitting the spacebar key which is 32 (0x20). It might be a good idea to familiarize yourself with this table to help you.
Reply
#26
Devil's Sunrise Wrote:Where do you use 9 bits? lol.

(Also, I never said anything about computing).

[SIZE="4"]-[/SIZE] during x0ring can be described as the rest of the numbers as 1s (though, not really is. It's just simplification). That is -1 = -11 = -111 = ...11111111111111111111111111 etc.
- 1 0000 0000 = ...1111 1111 1111 1111 1111 0000 0000. Though given, you have to translate the real number into "- x0r":
e.g. -101 into -1011 and -110 into -1010 etc.

That was frankly confusing. I understand what you mean, but what if the rest of the stuff after the bits was all zeros? That's why I don't like such display of operations. Though granted it's a lot better for extremely large numbers. (hey you actually decided to get dynamic!)

Fiel Wrote:In line of keeping with how programming languages work, using "00" as a space would not be the best. Why? Because all strings in programming languages end with a null terminator.

In the old days any ASCII value less than 32 was typically reserved for computer shyts only, like "BELL", which is 7.

Notepad converts any null bytes into 32s. Yet another reason why you shouldn't use nulls =P (loss of information, though it probably doesn't matter in most cases)

null bytes do show up in Notepad if you're reading directly from some files. Save it as a .txt and the null bytes disappear.
Reply
#27
Fiel Wrote:Well, it'd be a bit tough to go over all of binary arithmetic, but I guess it could be done.



In line of keeping with how programming languages work, using "00" as a space would not be the best. Why? Because all strings in programming languages end with a null terminator.

So if the string were just "MATT", the computer would see the letters "M", "A", "T", "T", and then a null terminator ("\0") to signify the end of the string.

So what is used otherwise?

There's something called the ASCII table. This table ascribes a number with every possible strike on the keyboard. So when you type the letter "A", on the keyboard, the computer reads 65 (0x41) and prints that to the screen. You'll notice on the ASCII table that there is a value that corresponds with hitting the spacebar key which is 32 (0x20). It might be a good idea to familiarize yourself with this table to help you.
I was sure it wouldn't fit very well with real computers. I just felt like making a simple code. I should get farmiliar with that table I guess.
Reply
#28
KajitiSouls Wrote:That was frankly confusing. I understand what you mean, but what if the rest of the stuff after the bits was all zeros? That's why I don't like such display of operations. Though granted it's a lot better for extremely large numbers. (hey you actually decided to get dynamic!)

Well, I found - to be somewhat inappropriate. I'm sure you did as well. (...) works prolly better. ((...) represents an infinite sequence of 1's)

I could try to explain how to bit-calc negative values, sh.

-1 is always represented in xoring as (...) 1. -10 is always (...) 10. -11 is (...) 01 or (...) 101.

First, find the positive binary number of the negative number. [1, 10, 11]
Second, remove 1 from the number. [0, 1, 10]
Third, NOT the number (switch all 1s to 0s and vice versa). [(...) 0, (...) 1, (...) 01]

Then XOR. If needed, convert back from negative value just reversing the way above. Tadaa, done.

Example:

[1 0000 0000, 1]
[1111 1111, 0]
[(...) 0000 0000, (...) 1]
Code:
(...) 0000 0000
XOR (...) 1111 1111
=         1111 1111

Then, the computing way is just simply to take (2^bits - a) XOR (2^bits - b). Gotta do it with a byte more though.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)