In: Computer Science
a) Make a comparison between 32 bit and 64 bit processors.
b) Compare and contrast XCode and gcc/MinGW JDK. How does both are different from each other ? What do both of these have in common?
c) ASCII encodes A and a or B and b as unique characters. How is this encoding impact the sorting strings?
d) During the download of Java JDK, what exactly are you downloading? when running a java program, what are 2 important applications ? explain the process of execution of a java program.
e) when python code line is copied from another text into a new text file, why does python interpreter not execute the code? ex: print "hello". Also why print() function is needed in python to run code?
a)
A 32-bit processor processes a lot lower amount of data compared to 64-bit processor as it can only access around 4GB of available RAM through registers as 232 is around while 64-bit can process 264 bit of data, or anything more than 4GB too, hence we can do multi-tasking, high performance tasks easily with 64-bit processors.
b)
Both Xcode and gcc compile C/C++ code and are very user friendly IDE but the main difference is that Xcode runs on iOS platform and the file it generates after compile is of extension .XCODEPROJ while gcc is for Windows platform and it generates .c extension file on compilation. Both are platform dependent, hence code compiled by one can't be executed on the other.
c)
ASCII encoding helps the system to parse the data at machine level easily as let's say ASCII code for A is 65, 65 can be easily converted in binary form and passed to the assembler but when it comes to sorting, as we can see ASCII code is different for each character, if we had a string Abracadabra and abracadabra, 1st one will be given the first position when sorting as ASCII of A (65) is lesser than a (97)
d)
When we are downloading JAVA JDK, we are downloading Java development kit, which consists of a compiler/interpreter as well as Java Virtual Machine. When we run a JAVA program, the java compiler (javac) converts the source code into a file with extension .java which is then fed to the Java virtual machine, which executes and we get a file with .java extension which can be on any platform as long as JVM is present on that, making JAVA a platform independent language unlike C/C++
e)
Because a simple print "hello" represents a set of character which when fed to the compiler, it just recognizes print as an identifier while "hello" as a literal and that's it. It doesn't get any instruction what to do with it. Hence we use a function print() which when passed to compiler, it recognizes it as a token and looks into the python library for it, when it matches with it as a function for output stream, it executes it and we see the result on the console.