Endianness: Let’s say you want to write a program for comparing two strings. You have a choice of using a 32-bit byte-addressable Big-endian or Little-endian architecture to do this. In either case, you can pack 4 characters in each word of 32-bits. Which one would you choose and how will you write such a program? [Hint: Normally, you would do string comparison one character at a time. If you can do it a word at a time instead of a character at a time, that implementation will be faster.]

What will be an ideal response?


The choice of endianness should not matter, so long as you are consistent in the comparison. Subtract each word in string A from string B. If you return zero, the strings are identical. Note, you can only perform this operation on the same system. The operation will be more complex if you are trying to compare a Big-endian system to a Little-endian system. You would have to compare character by character.

Computer Science & Information Technology

You might also like to view...

If you send the right message to the wrong object, Alice will automatically resend the message to the right object.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

A calculated ________ is an Excel table feature that takes a formula in a column and automatically adjusts cell references for each row in the table

A) total B) row C) column D) summary

Computer Science & Information Technology

Describe what tracert does and what it can be used to troubleshoot.

What will be an ideal response?

Computer Science & Information Technology

Due to the fact that data can be erased from files, what term do programmers generally prefer over permanent storage?

A. volatile storage B. temporary storage C. transit storage D. persistent storage

Computer Science & Information Technology