% 
% hw1.tex
%
%   This is a LaTeX template to get you started
%   making problem-set solutions
%
 
\documentclass[11pt]{article}
\usepackage{amsmath}
\setlength{\oddsidemargin}{0in}
\setlength{\evensidemargin}{0in}
\setlength{\textheight}{9.0in}
\setlength{\textwidth}{6.5in}
\setlength{\topmargin}{-0.5in}

% *** GRAPHICS RELATED PACKAGES ***
%

\usepackage{caption}
\usepackage{subcaption}
\usepackage{graphicx}

 \graphicspath{{./}}
 \DeclareGraphicsExtensions{.pdf,.jpeg,.png}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\title{\bf Data, Logic, and Computing\\[2ex] 
       \rm\normalsize ECS 17 (Winter 2024)}
\date{\today}
\author{Patrice Koehl\\koehl@cs.ucdavis.edu}

\begin{document}
\maketitle
\section*{\underline{Homework 2 - For 1/24/2024}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section*{Exercise 1 \emph{(10 points)}} 

Assuming that there are 149,878 characters in the UNICODE, and that each character is represented with the same number of bits, what is the minimal number of bits needed to store a word with 8 characters using this code?

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section*{Exercise 2 \emph{(4 questions, 2.5 points each; total 10 points)}} 

\begin{itemize}
\item What is the binary representation of the hexadecimal 7A?
\item What is the hexadecimal representation of the binary number 1100111?
\item How many bits are there in 22 bytes?
\item What is the largest  signed integer that can be stored in one byte?
\end{itemize}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section*{Exercise 3 \emph{(10 points)}} 

How much space would you need to store a 5 min song that has been sampled at 44.1 kHz, with each data point stored on 16 bits, in stereo (assume no compression).

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section*{Exercise 4  \emph{(4 questions, 2.5 points each; total 10 points)}} 

\begin{itemize}
\item Let $A$ be the binary number 1100110 and $B$ the binary number 11100010; find the binary number $C$ that satisfies $A+C = B$.
\item Let $A$ be the hexadecimal number \#3FF and $B$ the hexadecimal number \#F3F; find the hexadecimal number $C$ that satisfies $A+C = B$.
\item Let $A$ be the hexadecimal number \#3FF and $B$ the binary number 10000000000; find the hexadecimal number $C$ that satisfies $A+C = B$.
\item Let $A$ be the binary number 1000000000 and $B$ the hexadecimal number \#226; find the binary number $C$ that satisfies $A+C = B$.
\end{itemize}

\end{document}

