Written Assignment Unit 4
Written Assignment Unit 4
Binary code is employed in computers and digital devices to represent and transmit text, symbols,
or processor instructions (Admin, 2012). Since these devices operate based on two voltage values
(High or Low), all data involved in a process must be converted into this binary form. The most
effective way to do this is by using the binary numeral system, which consists of only two digits, 1 and
0. For instance, when you press a key on your keyboard, it generates a sequence of 1s and 0s unique to
each character, sending it as output. This conversion of data into binary code is known as encoding, and
ASCII, an abbreviation for the American Standard Code for Information Interchange, is a
standardized encoding for alphanumeric characters utilized in computers and related devices.
Binary Codes
The easiest way to encode data is by assigning a specific value, usually in decimal numbers, to a
character, symbol, or instruction (Admin, 2012). This assigned value is then converted into a binary
number, comprising only 1s and 0s, forming a sequence known as a binary string. The length of this
binary string determines how many different characters or instructions can be encoded. For instance,
with one digit, only two different characters or instructions can be represented, while two digits allow
for four. Various encoding methods use different lengths of binary strings, some with a fixed length
and others with a variable length. ASCII is an example of a fixed-length binary code, and UTF-16 and
ASCII is an alphanumeric character encoding using a 7-digit binary string in its original form,
allowing it to represent 128 characters (Admin, 2012). A later version known as extended ASCII
utilizes an 8-digit binary string, expanding its capacity to represent 256 different characters. ASCII
consists primarily of two types of characters: control characters (ranging from 0 to 31 and 127 in
decimal) and printable characters (ranging from 32 to 126 in decimal). ASCII is capable of representing
both uppercase and lowercase letters, numbers, symbols, and control keys.
Emacs is a highly customizable text editor developed in 1976 (Rouse, 2011). It is part of the
GNU project, written in C and Emacs Lisp. Emacs offers content-sensitive modes for different types of
text, including plain text, programming source codes, and HTML. These modes feature syntax
highlighting, using different colors to emphasize various syntax elements such as loops, comments, and
Emacs is available for free, and runs on most operating systems, including Windows, Mac OS X,
and Linux, and is widely used on Unix and Linux platforms. Beyond text editing, Emacs can execute
shell commands, access the internet, write and test programs, and manage emails.
Automatic indentation in Emacs helps organize code blocks, and it supports Unicode characters
for various languages. Additionally, Emacs features self-documentation, automatically generating and
displaying documentation for commands, variables, and internal functions in a program's source code.
Emacs may be downloaded for all platforms at this link https://emacs.sexy/. This is what the
tutorial, guided tour, and manuals. The standard menubar at the top with options like "File" and "Edit"
and the toolbar below it are there to perform operations in Emacs (Hamrick, 2012). However, a more
In Emacs, the running instance is referred to as a frame, not a window (Hamrick, 2012). Inside
Emacs, there's a window where you see the "GNU Emacs" welcome buffer. The blinking cursor, called
the point, acts like a standard text editor cursor and serves as the location for running functions. The
grey bar at the bottom is the status bar, providing information about the point and active buffer. The
mini-buffer below it displays occasional status messages and is where you enter Emacs commands.
Emacs has two crucial keys used in keyboard shortcuts: the "meta" key (often the "Alt" key) and
the "Ctrl" key. They're abbreviated as "M" and "C" in key combinations, like M-x and C-f. Be aware
that key combos like C-c | and C-c C-| are different. The essential shortcuts are C-h C-h (help), C-g
(quit), and M-x (run command). Help assists when stuck, quit cancels an operation, and run command
content you're working on, like text, code, or even images. Imagine it as a blank canvas or document
where you can write, edit, and manipulate your data. In Emacs, you can have multiple buffers open
simultaneously, each displaying file contents, program outputs, or other information. By default, Emacs
starts with a single window showing the GNU Emacs buffer, along with a Messages buffer for Emacs-
To switch between buffers, use the C-x b key combination. Pressing the tab key in the mini-buffer
displays a list of open buffers. You can select a buffer by typing its name and pressing enter.
Additionally, you can cycle through buffers sequentially with C-x right and C-x left. Windows in
Emacs are views into buffers, and you can have multiple windows open in the same frame, allowing
To open and load a file into a buffer in Emacs, press C-x C-f. This will prompt the mini-buffer
with "Find file: ~/path/to/current/directory/." Similar to switching buffers, you can use the tab key to
list files in the specified directory. Type the desired file name (and modify the path if needed), then
buffer with a new file name (similar to "Save As"), use C-x C-w, and it will ask you to specify the file
name. If the file already exists, it will confirm whether you intend to overwrite it.
When you're finished with a buffer and want to close/kill it, use C-x k. This prompts you in the
mini-buffer to enter the name of the buffer to kill, similar to when switching buffers. If you don't
specify a buffer, it will default to killing the active buffer, and Emacs will display another open buffer
The actions of "cut," "copy," and "paste" have different names in Emacs, with "kill" being similar
to "cut" and "yank" being similar to "paste." To perform these actions, you need to first select a
"region." To select a region, move the cursor to one end of the desired area and press C-space. A
message in the mini-buffer will say "Mark set" or “Mark activated”. Move the cursor to the other end
of the region, and the highlighted text will indicate the selected region.
Now that you've selected a region, you can perform operations on it. To delete a selected region,
use C-w. Alternatively, you can implicitly define a region from the cursor to the end of the current line
and delete it using C-k. For pasting, use C-y. If you want to undo the last action, press C-_ several
counterintuitive—deleting a region without deleting it? The distinction lies in Emacs's ability to store
multiple regions in a "kill ring" when you delete. Yanking retrieves text from the kill ring back into the
buffer. So, when you delete a region without removing it, you're copying its contents to the kill ring
To search within a buffer, use C-s for forward search or C-r for backward search. Enter your
search query in the mini-buffer and press C-s or C-r to cycle through the results. When you reach the
end of the search results, Emacs will show a "Failing I-search" message. If you continue the search, it
will wrap back to the beginning, displaying an "Overwrapped I-search" message in the mini-buffer.
To locate and replace a search query, use M-%. Input the text you want to find, press enter, and
then enter the replacement text. Emacs will highlight the text to be replaced, and you can press 'space'
to replace it, 'n' to skip to the next one, or '!' to replace all occurrences.
Navigating with just the arrow keys can be slow, so these key combinations can help. To move
the cursor up or down a whole paragraph, use C-up or C-down. For moving past a whole word, use C-
left or C-right. To go to the beginning of a line, press the home key; for the end of a line, use the end
key. Move up or down a page with the page up and page down keys. To go to the start of the buffer,
use M-.
Conclusion
Emacs is a powerful text editor that can be used to quickly edit files, once you familiarize
yourself with the different keyboard shortcuts. While it takes some adjustment, as the keyboard
shortcuts differ from the more familiar ones (like Ctrl-C for copy and Ctrl-V for paste), it can be be
Binary code is a broad term referring to the encoding of characters or instructions (Admin, 2012).
ASCII, on the other hand, is a specific and widely adopted convention for encoding characters, serving
as the predominant binary encoding scheme for over thirty years. The length of binary code can vary
based on the number of characters, instructions, or the encoding method. In the case of ASCII, it
employs a 7-digit binary string, and for extended ASCII, it uses an 8-digit binary string.
References
Admin. (2012, November 18). Difference between binary and ASCII. Compare the Difference
ascii/
http://www.jesshamrick.com/2012/09/10/absolute-beginners-guide-to-emacs/
https://www.techopedia.com/definition/24107/emacs