html第六课时js基础

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>

    <script type="text/javascript">//js的样式开头必须是这样的。
        function validate()//他的方法必须以function开头。
        {

            var staffNo=document.getElementById('staffNo');
            var staffName=document.getElementById('staffName');
            var sex=document.getElementsByName('Sex');
            var pos=document.getElementById('pos');
            var password=document.getElementById('password');
            var introduction=document.getElementById('introduction');
            if(staffNo.value=="")
            {
                alert("员工工号不能为空!");
                staffNo.focus();
                return false;
            }
            if(staffName.value=="")
            {
                alert("员工姓名不能为空!");
                staffName.focus();
                return false;
            }
            if(sex[0].checked)//checkbox的验证是否为空的方法
            {
                console.log("您选择了男","提示")
                /*alert(sex[0].value);*/
            }
            else
            {
                console.log("您选择了女","提示")
                /*alert(sex[1].value);*/
            }
            /*var index=pos.selectedIndex;
            var posvalue=pos.options[index].text;*/
            if(pos.value=="")
            {
                alert("请选择职位!");
                pos.focus();
                return false;
            }
            if(introduction.value=="")
            {
                alert("请输入简介!");
                introduction.focus();
                return false;
            }

            /*string.prototype.trim=function()
             {
             return this.replace(/(^\s*)|(\s*S)/g,"");
             正则表达式
             }*/

           return true;
        }
    </script>
</head>
<body>
<form action="" method="post">
    <table border="1"  align="center" bordercolor="#ccc" cellpadding="5px">
        <tr align="center">
            <td colspan="3" >
                员工信息
            </td>
        </tr>
        <tr >
            <td align="center"  width="20%" >
                工号:
            </td>
            <td  width="50%" align="left" >
                <input name="staffNo" id="staffNo" class="input">//添加Id唯一标识
            </td>
            <td width="30%" rowspan="5">
                <img width="100%" id="image" height="300px" src="images/1.jpg">
            </td>
        </tr>
        <tr >
            <td>
                姓名:
            </td>
            <td align="left" >
                <input name="staffName" id="staffName" class="input">
            </td>
        </tr>
        <tr >
            <td>
                性别:
            </td>
            <td  align="left">
                <input type="radio" name="Sex" value="Man" checked>男
                <input type="radio" name="Sex"  value="Woman">女
            </td>
        </tr>
        <tr >
            <td >
                照片:
            </td>
            <td align="left" >
                <input type="file" id="photo" name="staffPic">
            </td>
        </tr>
        <tr >
            <td>
                职位:
            </td>
            <td align="left">
                <select name="pos" id="pos">
                    <option value="">
                        请选择职位
                    </option>
                    <option value="1002">
                        医生
                    </option>
                    <option value="1002">
                        护士
                    </option>
                </select>
            </td>
        </tr>
        <tr >
            <td>
                密码:
            </td>
            <td colspan="2" align="left">
                <input type="password" id="password" name="password" class="input">
            </td>
        </tr>
        <tr class="tr">
            <td>
                简介:
            </td>
            <td colspan="2"  align="left">
                <textarea cols="80" rows="8" id="introduction"></textarea>
            </td>
        </tr>
        <tr >
            <td colspan="3">
                <input type="submit" οnclick="return validate()" value="提交">
                <input type="reset" value="重置">
            </td>
        </tr>
    </table>
</form>
</body>
</html>
<pre name="code" class="html">table{
    border-collapse: collapse;
    width: 60%;
    margin-top:8em;
    text-align:center;

}
tr{
    height: 50px;
}
.tr{
    height:100px;
}
.input{
    width:200px;
    height:22px;
}
select{
    width:80px;
    height:22px;
}
textarea{
    text-indent:2em;
}


 

汉字字库存储芯片扩展实验 # 汉字字库存储芯片扩展实验 ## 实验目的 1. 了解汉字字库的存储原理和结构 2. 掌握存储芯片扩展技术 3. 学习如何通过硬件扩展实现大容量汉字字库存储 ## 实验原理 ### 汉字字库存储基础 - 汉字通常采用点阵方式存储(如16×16、24×24、32×32点阵) - 每个汉字需要占用32字节(16×16)到128字节(32×32)不等的存储空间 - 国标GB2312-80包含6763个汉字,需要较大存储容量 ### 存储芯片扩展方法 1. **位扩展**:增加数据总线宽度 2. **字扩展**:增加存储单元数量 3. **混合扩展**:同时进行位扩展和字扩展 ## 实验设备 - 单片机开发板(如STC89C52) - 存储芯片(如27C256、29C040等) - 逻辑门电路芯片(如74HC138、74HC373等) - 示波器、万用表等测试设备 - 连接线若干 ## 实验步骤 ### 1. 单芯片汉字存储实验 1. 连接27C256 EPROM芯片到单片机系统 2. 将16×16点阵汉字字库写入芯片 3. 编写程序读取并显示汉字 ### 2. 存储芯片字扩展实验 1. 使用地址译码器(如74HC138)扩展多片27C256 2. 将完整GB2312字库分布到各芯片中 3. 编写程序实现跨芯片汉字读取 ### 3. 存储芯片位扩展实验 1. 连接两片27C256实现16位数据总线扩展 2. 优化字库存储结构,提高读取速度 3. 测试并比较扩展前后的性能差异 ## 实验代码示例(单片机部分) ```c #include <reg52.h> #include <intrins.h> // 定义存储芯片控制引脚 sbit CE = P2^7; // 片选 sbit OE = P2^6; // 输出使能 sbit
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值