Saturday, March 28, 2015

Blog #7: The Shapes of Logic

     Logic is the study of valid reasoning. What we discussed today is about Digital Logic and Boolean Algebra.

     Since I am an Applied Mathematics student, studying logic is our foundation. We studied and proved statements, arguments, and truth tables. So this topic is not that new to me. But still, I got excited because this was something familiar. Unlike those previous very mathematical meetings where some of my classmates dread, I was happy to see something familiar in a world unfamiliar to me. Chos.

     In digital logic, we study about computers of course, and how they process information and perform arithmetic. That's where logic gates enter. Logic gates are building blocks of a circuit. They usually have two inputs (see truth tables below, with inputs A and B) and one output, depending on the gate they pass through. Logic 1 means on, high, true, yes, or closed switch. Logic 0 means off, low, false, no, or open switch.

http://www.eetimes.com/document.asp?doc_id=1274508


http://www.schoolphysics.co.uk/age16-19/Electronics/Logic%20gates/text/Logic_gates/index.html

  • The NOT gate is just an inverter. The output is just a negation of the input.
  • In the AND gate, the output is 1 if both of the inputs are 1. Otherwise, the output is 0. The NAND gate is just its negation.
  • In the OR gate, the output is 1 if at least one of the inputs is 1. Otherwise, the output is 0. The NOR gate is just its negation.
  • In the XOR gate, the output is 1 if one of the inputs is 1. If the inputs are the same (both 0 or both 1), then the output is 0.


http://gcat.davidson.edu/GcatWiki/index.php/Logic_Gates:_Symbols_and_Truth_Tables


     What I liked about this is that it has shapes, and I know and understand how it is used digitally. Before, in my math subjects, we prove truth tables and the operators (in Boolean Algebra), we memorize identities and theorems. We use them in real life sentences and phrases, or arguments. It is amazing how early people made these statements into logic gates that were made into transistors and used in circuits, and still easy to understand. Before, I do not know why we do all these proving. Now I understand that manufacturers of transistors (composed of logic gates) wanted to cut down the costs of making these gates so they simplified the most complex logic gates.

     Connecting logic gates and analyzing more of its complex forms, and simplifying them is really challenging but it actually is fun! To see what I mean, I recommend you to try experimenting here: http://logic.ly/demo/.

http://heythrop.su/logic-society/

Saturday, March 21, 2015

Blog #6: Drive Attack! (Google Drive & Shingeki no Kyojin)

Document Collaboration using Google Drive


     Before Google Drive, I remembered using Dropbox in Yahoo!Mail. Yes, I have my own personal laptop as my storage, plus a few memory cards and flash drives, but no external hard drive.
     Why do I need an external hard drive when I have my own personal laptop with 640 gb storage? Well, I have my needs. :P  I am the type of person who doesn’t easily let go of memories, or in this case, files. Good memories, bad memories, insignificant memories, I don’t care, I still keep them. I am a junior student, and all my files since my freshman year, generated or not generated from my laptop, are stored in it. I have folders of my freshman, sophomore, and junior year, and subfolders for the first and second semesters for every year, and of course, another set of subfolders for every subject. Also, all videos, movies, songs, etc. that I have obtained ever since I got my laptop are stored here. I only probably delete when the file is corrupted, or when I already transferred the movies that my daddy asked me to download to his PC. Even when I don’t have any slight interest in a very old movie, or even the slightest want to listen to a song, I still do not delete those. I don’t really know. I always have a feeling that I may make use of them someday. Baka manghinayang ako eh. And that, my friends, is why I think I need an external hard drive. (I am currently accepting donations, please just comment below. Haha!)
     It really is a good thing to have an online storage (if you forget your password, then that’s a different story :P). Not only does it save space on my PC, it also makes it easier to share my files to other people! (Of course only with an active internet connection :P)
     Google Drive not only offers a default of 15 gb storage. Files in your drive can also be shared to others, by sending the files to their email, or sending a link of your drive to their email. We can also create files an share it to others, real time!

     In our IT 1 meeting last Wednesday, we were asked to make a presentation about the anime “Attack on Titan (Shingeki no Kyojin)” using the Google Drive. We were grouped into 5, others with 5 members each, while we only have 4. Each group representative was asked to create a presentation file, shared with the other members of the group. Poof! It became Koko Krunch! lol. We have a shared document. It really amazed me because we can work on a single document all at once, and I can also see where my groupmates are currently working on. We can also conduct a group chat where we can converse while making our presentation. This is a very nice advancement in technology because it saved time and effort. Under normal circumstances, group meetings are held where the members of the group agreed to be at their agreed common time. After that first meeting, they still had to make a second meeting wherein they compile all their works. This tool makes everybody be flexible. Aside from having less problems in deciding when and where to meet, the group members can actually see the progress of their presentation. GOOD GOING, GOOGLE! *2 thumbs up*

Shingeki no Kyojin (Attack on Titan)


     Before all that Google Drive, Ma’am Marya introduced us to an anime that I later learned is new and of course was still ongoing, with only 25 episodes finished. She showed us only the first four episodes. I really didn't see the connection of IT 1 with the anime no matter how I tried, so I eventually decided to just sit there and watched. As minutes go by, I get more and more hooked. When we neared episode 4, I was silently wishing for a time extension, because I really got hooked and every episode really keeps me hanging! After the 4th episode ended, my classmates protested and asked for more, but since we only have an hour left for our actual lesson, sad for us :( Pero feeling ko binitin lang talaga kami ni Ma'am. Asan ang hustisya?! Lol. The look on my classmates' faces were so epic. Haha.

     My seatmates, Alec and Ryan, knew about the anime beforehand. I got so curious that I bombarded them with so many questions while we were watching. Many of those questions were left unanswered, because it’s still ongoing. I only knew about the real identities (Are they purely persons or are they titans?) of some of the soldiers alongside Eren, because they are spoilers T.T Before the day ended, I secured myself with a COPY (Oh yeah! :P) of the anime’s Season 1 (Thank you Alec!). I cannot wait for the next season! Good thing there’s manga hehehe. Later, I also learned that a live action movie of Shingeki no Kyojin will be released probably this summer! Another thing to watch out for ;)

     If you’re not into weird and gory stuff, don’t watch this! But you’ll miss the awesomeness of the soldiers, the military, and the survey corps, etc. For someone like me who only watched cute anime stuff with love stories and a few adventures and a few magic stuff and eventually stopped, this made me reconsider watching anime again. I am so hooked! (This is all your fault Ma’am Marya! Now I’m so bitin huhuhu. By the way, thank you for introducing the anime! I will be so disappointed if Eren and Mikasa did not end up together lol)

Friday, March 13, 2015

Blog #5: 1+1=10? Are you kidding me?

Last time, I talked about decimal, binary, octal, and hexadecimal number systems and each of their conversions. Today, the topic is about...

BINARY ARITHMETIC

Remember the binary numbers? Binary numbers are numbers composed of 0's and 1's. For example, 100 is equal to 4, 010 is equal to 2, 111 is equal to 7, etc. (For other conversions, please refer to my previous blog entry.)

In binary arithmetic, we perform addition, subtraction, and other mathematical operations, just like a normal number. But because we are in binary, the end results must also be in binary. Is that even possible? Of course. Normally, 1+1 is equal to 2. How do we express 2 in binary?
Q = quotient; R = remainder
But we can add binary digits simpler, without converting its decimal equivalent to binary every single time. Here are the rules:
We're not done yet! In binary arithmetic, of course like in normal decimal numbers, we consider positives and negatives. We cannot simply prefix a minus sign on the binary number if it is a negative. Look at the figure below:

Positive binary numbers

In binary arithmetic, it is wrong to represent 7 as 111. Since 7 is a positive number, we affix a 0 in front. So in binary arithmetic, 7 is 0111.

Negative binary numbers

If we negate a number, for example -7, we simply do not add a 1 to make it 1111. In converting a negative number to a negative binary number, we have what we call a 1's complement and a 2's complement. We first get the 1's complement, then the 2's complement, before we say that the binary number we get is really the negative of the number.

  • 1's complement
              In 1's complement, we simply take the complement or the reverse of the digits of the binary number. For example, 7, which is 0111, will become 1000 after 1's complement.

  • 2's complement
              In 2's complement, we simply add 1 to the leftmost digit of the binary number we got from 1's complement. For example, the 2's complement of 7 is 1001, which resulted from 1000+1. 1001 now is -7.

Now how do we check if our conversion is correct? 

Remember how we convert binary to decimal?
The conversion of 7 after the 2's complement is 1001 = -7

Now that we are all set, we can perform addition and subtraction.



My personal reactions to this lesson

After the rules have been given to us, and I saw 1 + 1 is equal to 10, and 1 + 1 + 1 is 11, I was like
 















But then eventually I understood, and as the lesson goes I become more interested on how to apply other mathematical operations in binary numbers, like multiplication and division. I think this lesson is fun though challenging if we increase n, but it's nice to know that we are closer to understanding the basics of the computer's brain. :)


Saturday, March 7, 2015

Blog #4: "Can I have your digits?"


Numeral / Number Systems

(all images are from Google Images, unless stated otherwise.)



     Well, numbers are part of our lives. Before coming up with 1, 2, 3, to infinity, our ancestors, the Romans, Egyptians, and other ancient mathematicians developed number systems that I'm sure we are familiar with, or we have encountered in school.


Roman Numerals
Egyptian Numerals
Unary Number System















     Numeral systems are notations of expressing numbers. Do you remember the methods of counting you used to do?



     I often use the unary numerals, or simply tallying. When counting in small digits, I use my fingers. When I count large digits, I group them. For example, when I count my coins from my piggybank, I group them in tens so I could easily count.

Our lesson for the week's meeting - Decimal, Binary, Octal, Hexadecimal


Decimal Number System (base 10)

     The counting we do in everyday life, though not all of us may know it, or put attention to it, or even give a thought about what it is, is called the DECIMAL NUMBER SYSTEM. The decimal number system makes use of base 10. Now what am I talking about? Base 10 means 10 digits in a place value of a position. In the first position, or in the ones place, the 10 digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. When you reach 9, you go back to 0 in the ones place, and then add 1 in the tens place. When you reach 9 again in the ones place, you go back to 0, then add another 1 in the tens place, making your count 20.

from http://drstienecker.com/tech-332/1-numbering-systems-and-conversions/

     Binary, octal, and hexadecimal are the number systems used by our computer. Simply put, those are the "languages" of the computer. Since we "talk" in decimal, we must know how to convert it to binary, octal, and hexadecimal so the computer will understand our command.

Binary Number System (base 2)




     We all know the famous binary digits. It is the smallest unit of data in a computer. Binary is composed of 2 digits (base 2): 0 and 1, or "on" and "off", etc.

from http://code.tutsplus.com/articles/number-systems-an-introduction-to-binary-hexadecimal-and-more--active-10848

     In converting binary to base 10 or decimal, you just need to follow the table above. You simply multiply the binary digit to its corresponding power of two value, depending on the position.

from http://drstienecker.com/tech-332/1-numbering-systems-and-conversions/
     The binary number 1101 (from the image above) yields a decimal equivalent of 13 (base 10).


Octal Number System

     Octal, or base 8, is composed of 0, 1, 2, 3, 4, 5, 6, and 7. It is like counting like the decimal way, but instead of 9, we end at 7.

from http://drstienecker.com/tech-332/1-numbering-systems-and-conversions/
     If in binary, we follow the power of two value, in octal we follow the power of eight in converting. The number 437 base 8 is equal to 287 base 10. How did we get that? Let's start with the ones place. 7 multiplied to 8 raised to 0 = 7x1 = 7. Tens place: 3 multiplied to 8 raised to 1 = 3x8 = 24. Hundreds place: 4 multiplied to 8 raised to 2 = 4x64 = 256. Adding them all up, we get 287. Simple, right?


Hexadecimal Number System (Base 16)

     Remember the colors when viewed in html? Those have digits composed of numbers 0-9 and letters A-F.

from Wikipedia (Web Colors)
     These digits are in hexadecimal. Hexadecimal, or base 16, is composed of 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F. A represents 10 in decimal, B is 11, C is 12, D is 13, E is 14, and F is 15.

from http://drstienecker.com/tech-332/1-numbering-systems-and-conversions/
     In converting hexadecimal to decimal, we follow the same pattern we use in binary and octal. The only difference is we use the power of 16 values as multiplier to the digits given.



     There are different converter apps out there in the internet, but it is still useful and liberating if we know these ourselves.

For more information, and conversion techniques (those that I did not explain further, like converting octal to binary, etc.), visit
1. http://code.tutsplus.com/articles/number-systems-an-introduction-to-binary-hexadecimal-and-more--active-10848 ; and
2. http://drstienecker.com/tech-332/1-numbering-systems-and-conversions/ .